Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ Maciej Dems <maciej.dems@p.lodz.pl>
Magnus Bäck <magnus@noun.se>
Maik Stuebner <maik@stuebner.info>
Malte Rabenseifner <mail@malte-rabenseifner.de>
Manas Singh <00manassingh00@gmail.com>
Manuel Reiter <reiter@csc.uni-frankfurt.de>
Marc Rupprecht <marc.rupprecht@netways.de>
Marcus van Dam <marcus@marcusvandam.nl>
Expand Down
6 changes: 6 additions & 0 deletions doc/09-object-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -1878,6 +1878,12 @@ or any other OTLP-compatible backend that accepts OTLP data over HTTP. This conf
[otlpmetrics feature](14-features.md#otlpmetrics-writer). You can find more information about OpenTelemetry and OTLP
on the [OpenTelemetry website](https://opentelemetry.io/).

!!! info

The official package builds for Debian 11, Ubuntu 22.04 and Amazon Linux 2 do not include this object type.
These builds disable OpenTelemetry support (`ICINGA2_WITH_OPENTELEMETRY=OFF`) because the
default Protobuf compiler version is too old for the required code generation.

A basic copy and pastable example configuration is shown below:

```
Expand Down
15 changes: 15 additions & 0 deletions doc/14-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,21 @@ In order to enable this feature, you can use the following command:
icinga2 feature enable otlpmetrics
```

!!! info

**Package availability note (Debian 11 / Ubuntu 22.04 / Amazon Linux 2):**
The official Icinga 2 packages for Debian 11, Ubuntu 22.04 and Amazon Linux 2 are built with
`-DICINGA2_WITH_OPENTELEMETRY=OFF`, because the default Protobuf compiler in these
distributions is too old for the OpenTelemetry code generation used by Icinga 2.
As a result, the `otlpmetrics` feature (and `OTLPMetricsWriter` type) is not available
in those package builds.

You can verify this on a node with:

```bash
icinga2 feature list | grep otlpmetrics
```

By default, the OTLPMetrics Writer expects the OpenTelemetry Collector or any other OTLP HTTP receiver to listen at
`127.0.0.1` on port `4318` but most of the third-party backends use their own ports, so you may need to adjust the
configuration accordingly. Additionally, the `metrics_endpoint` can vary based on the backend you are using.
Expand Down
6 changes: 6 additions & 0 deletions doc/16-upgrading-icinga-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ ElasticsearchWriter is deprecated in v2.16 and will be removed in v2.18. In case
we suggest migrating to the new OTLPMetricsWriter as a replacement. The index data structure in Elasticsearch will be
different though, so any third-party tools working with that data will need to be adapted as well.

!!! info

The official Icinga 2 packages for Debian 11, Ubuntu 22.04 and Amazon Linux 2 are currently built without
OpenTelemetry support (`ICINGA2_WITH_OPENTELEMETRY=OFF`), so `OTLPMetricsWriter` is not
available there unless you build Icinga 2 with a newer Protobuf toolchain.

### Deprecation of user-defined DSL Namespaces

If you were previously using constructs like `namespace my_utils { ... }` in your config, we suggest
Expand Down
2 changes: 1 addition & 1 deletion lib/icingadb/icingadb-objects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1905,7 +1905,7 @@ void IcingaDB::SendStateChange(const ConfigObject::Ptr& object, const CheckResul
auto eventTime (cr->GetExecutionEnd());
auto eventTs (TimestampToMilliseconds(eventTime));

Array::Ptr rawId = new Array({m_EnvironmentId, object->GetName()});
Array::Ptr rawId = new Array({m_EnvironmentId, GetObjectIdentifier(object)});
rawId->Add(eventTs);

RedisConnection::Query xAdd ({
Expand Down
2 changes: 1 addition & 1 deletion lib/icingadb/icingadb-utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ String IcingaDB::GetObjectIdentifier(const ConfigObject::Ptr& object)
*/
String IcingaDB::CalcEventID(const char* eventType, const ConfigObject::Ptr& object, double eventTime, NotificationType nt)
{
Array::Ptr rawId = new Array({object->GetName()});
Array::Ptr rawId = new Array({GetObjectIdentifier(object)});
rawId->Insert(0, m_EnvironmentId);
rawId->Insert(1, eventType);

Expand Down
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ if(ICINGA2_WITH_PGSQL)
endif()

if(ICINGA2_WITH_ICINGADB)
list(APPEND types_test_SOURCES icingadb-eventid.cpp)
list(APPEND types_test_SOURCES $<TARGET_OBJECTS:icingadb>)
endif()

Expand Down
22 changes: 22 additions & 0 deletions test/icingadb-eventid.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// SPDX-FileCopyrightText: 2012 Icinga GmbH <https://icinga.com>
// SPDX-License-Identifier: GPL-2.0-or-later

#include "icingadb/icingadb.hpp"
#include "icinga/host.hpp"
#include <BoostTestTargetConfig.h>

using namespace icinga;

BOOST_AUTO_TEST_CASE(calc_event_id_uses_object_identifier)
{
Host::Ptr host = new Host();
host->SetName("master01");

host->SetIcingadbIdentifier("id-a");
auto first = IcingaDB::CalcEventID("state_change", host, 1710000000.123);

Check failure on line 16 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / amazonlinux:2

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 16 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / alpine:bash

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const icinga::ConfigObject::Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 16 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / debian:11

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 16 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / amazonlinux:2023

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 16 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / debian:12

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const icinga::ConfigObject::Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 16 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / debian:13

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const icinga::ConfigObject::Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 16 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / fedora:41

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const icinga::ConfigObject::Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 16 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / fedora:42

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const icinga::ConfigObject::Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 16 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / fedora:43

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const icinga::ConfigObject::Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 16 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / fedora:44

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const icinga::ConfigObject::Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 16 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / opensuse/leap:15.6

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 16 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / opensuse/leap:16.0

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const icinga::ConfigObject::Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 16 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / rockylinux:8

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const icinga::ConfigObject::Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 16 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / rockylinux:9

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 16 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / rockylinux/rockylinux:10

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const icinga::ConfigObject::Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 16 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / registry.suse.com/suse/sle15:15.6

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 16 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / registry.suse.com/suse/sle15:15.7

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 16 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / registry.suse.com/bci/bci-base:16.0

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const icinga::ConfigObject::Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 16 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / ubuntu:22.04

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 16 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / ubuntu:24.04

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const icinga::ConfigObject::Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 16 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / ubuntu:25.04

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const icinga::ConfigObject::Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 16 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / ubuntu:25.10

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const icinga::ConfigObject::Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 16 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / ubuntu:26.04

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const icinga::ConfigObject::Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 16 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / debian:11 (linux/386)

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 16 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / debian:12 (linux/386)

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const icinga::ConfigObject::Ptr&, double, icinga::NotificationType)' is private within this context

host->SetIcingadbIdentifier("id-b");
auto second = IcingaDB::CalcEventID("state_change", host, 1710000000.123);

Check failure on line 19 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / amazonlinux:2

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 19 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / alpine:bash

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const icinga::ConfigObject::Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 19 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / debian:11

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 19 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / amazonlinux:2023

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 19 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / debian:12

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const icinga::ConfigObject::Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 19 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / debian:13

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const icinga::ConfigObject::Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 19 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / fedora:41

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const icinga::ConfigObject::Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 19 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / fedora:42

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const icinga::ConfigObject::Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 19 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / fedora:43

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const icinga::ConfigObject::Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 19 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / fedora:44

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const icinga::ConfigObject::Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 19 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / opensuse/leap:15.6

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 19 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / opensuse/leap:16.0

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const icinga::ConfigObject::Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 19 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / rockylinux:8

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const icinga::ConfigObject::Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 19 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / rockylinux:9

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 19 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / rockylinux/rockylinux:10

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const icinga::ConfigObject::Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 19 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / registry.suse.com/suse/sle15:15.6

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 19 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / registry.suse.com/suse/sle15:15.7

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 19 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / registry.suse.com/bci/bci-base:16.0

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const icinga::ConfigObject::Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 19 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / ubuntu:22.04

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 19 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / ubuntu:24.04

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const icinga::ConfigObject::Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 19 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / ubuntu:25.04

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const icinga::ConfigObject::Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 19 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / ubuntu:25.10

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const icinga::ConfigObject::Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 19 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / ubuntu:26.04

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const icinga::ConfigObject::Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 19 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / debian:11 (linux/386)

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const Ptr&, double, icinga::NotificationType)' is private within this context

Check failure on line 19 in test/icingadb-eventid.cpp

View workflow job for this annotation

GitHub Actions / debian:12 (linux/386)

'static icinga::String icinga::IcingaDB::CalcEventID(const char*, const icinga::ConfigObject::Ptr&, double, icinga::NotificationType)' is private within this context

BOOST_CHECK_NE(first, second);
}
Loading