Skip to content

Commit

Permalink
Merge pull request #19 from heiko-holz/features/feat-16-otlp-exporter
Browse files Browse the repository at this point in the history
Closes #16: [Feature] - Add support for OTLP exporters (tracing and metrics)
  • Loading branch information
Heiko Holz authored Jan 5, 2023
2 parents 47ec595 + 86c7d6d commit 054ad0a
Show file tree
Hide file tree
Showing 31 changed files with 1,894 additions and 207 deletions.
98 changes: 95 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,14 @@ inspectit-eum-server:
exporters:
metrics:
prometheus:
enabled: true
enabled: ENABLED
host: localhost
port: 8888
tracing:
otlp:
enabled: ENABLED
protocol: grpc
endpoint: localhost:4317

security:
enabled: false
Expand Down Expand Up @@ -135,12 +140,99 @@ In order to provide selected tags to each measurement by default, tags can be de
##### Automated Geolocation Detection
By using the tag `COUNTRY_CODE`, the geolocation of the requester is resolved by using the requester IP and the [GeoLite2 database](https://www.maxmind.com). If the IP cannot be resolved, the tag value will be empty.

##### Exporters
By now, the prometheus exporter is available. If `ènabled` is set to true, the exporter is exposes the metrics under
##### Metrics Exporters

The inspectIT Ocelot EUM Server currently supports the following metrics exporters:

|Exporter |Supports run-time updates| Push / Pull |Enabled by default|
|---|---|---|---|
|[Prometheus Exporter](#prometheus-exporter)|Yes|Pull|No|
|[OTLP Exporter (Metrics)](#otlp-exporter-metrics) [[Homepage](https://github.com/open-telemetry/opentelemetry-java/tree/main/exporters/otlp/metrics)]|Yes|Push|No|

###### Prometheus Exporter
If `enabled` is set to `ENABLED`, the exporter is exposes the metrics under
```bash
http://[host]:[port]/metrics
```

Prometheus exporter exposes the metrics in Prometheus format.
When enabled, the EUM starts a Prometheus HTTP server in parallel with your application.
The server is by default started on the port `8888` and metrics can then be accessed by visiting http://localhost:8888/metrics.

The following properties are nested properties below the `inspectit-eum-server.exporters.metrics.prometheus` property:

|Property | Default | Description
|---|------------|---|
|`.enabled`| `DISABLED` |If `ENABLED` or `IF_CONFIGURED`, the inspectIT Ocelot agent will try to start the Prometheus metrics exporter and Prometheus HTTP server.
|`.host`| `0.0.0.0` |The hostname or network address to which the Prometheus HTTP server should bind.
|`.port`| `8888` |The port the Prometheus HTTP server should use.

###### OTLP Exporter (Metrics)


The OpenTelemetry Protocol (OTLP) exporters export the metrics to the desired endpoint at a specified interval.
To enable the OTLP exporters, it is only required to specify the `url`.

The following properties are nested properties below the `inspectit-eum-server.exporters.metrics.otlp` property:

| Property | Default | Description |
|--------------------------|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `.enabled` | `IF_CONFIGURED` | If `ENABLED` or `IF_CONFIGURED`, the inspectIT Ocelot agent will try to start the OTLP gRPC metrics exporter. |
| `.endpoint` | `null` | Target to which the exporter is going to send metrics, e.g. `http://localhost:4317` |
| `.protocol` | `null` | The transport protocol, see [OTEL documentation](https://opentelemetry.io/docs/reference/specification/protocol/exporter/). Supported protocols are `grpc` and `http/protobuf`. |
| `.preferred-temporality` | `CUMULATIVE` | The preferred output aggregation temporality, see [OTEL documentation](https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/autoconfigure/README.md). Supported values are `CUMULATIVE` and `DELTA`.|
| `.headers` | `null` | Key-value pairs to be used as headers associated with gRPC or HTTP requests, see [OTEL documentation](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md).|
| `.compression` | `NONE` | The compression method, see [OTEL documentation](https://opentelemetry.io/docs/reference/specification/protocol/exporter/). Supported compression methods are `gzip` and `none`. |
| `.timeout` | `10s` | Maximum time the OTLP exporter will wait for each batch export, see [OTEL documentation](https://opentelemetry.io/docs/reference/specification/protocol/exporter/). |

##### Trace Exporters

Tracing exporters are responsible for passing the recorded tracing data to a corresponding storage.
The inspectIT Ocelot EUM Server currently supports the following trace exporters:

* [Jaeger](#jaeger-exporter) [[Homepage](https://www.jaegertracing.io/)]
* [OTLP (Traces)](#otlp-exporter-traces) [[Homepage](https://github.com/open-telemetry/opentelemetry-java/tree/main/exporters/otlp/trace)]

##### General Trace Exporter Settings

These settings apply to all trace exporters and can set below the `inspectit-eum-server.exporters.tracing` property.

| Property | Default | Description |
|-----------------|-----------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `.service-name` | `${inspectit.service-name}` | The value of this property will be used to identify the service a trace came from. Please note that changes of this property only take effect after restarting the agent. |

##### Jaeger Exporter

InspectIT EUM Server supports thrift and gRPC Jaeger exporter.

By default, the Jaeger exporters are enabled but the URL/gRPC `endpoint` needed for the exporter to actually start is set to `null`.

The following properties are nested properties below the `inspectit.exporters.tracing.jaeger` property:

|Property | Default | Description |
|---|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|`.enabled`| `IF_CONFIGURED` | If `ENABLED` or `IF_CONFIGURED`, the agent will try to start the Jaeger exporter. If the url is not set, it will log a warning if set to `ENABLED` but fail silently if set to `IF_CONFIGURED`. |
|`.endpoint`| `null` | URL endpoint under which the Jaeger server can be accessed (e.g. http://127.0.0.1:14268/api/traces). |
|`.protocol`| `grpc` | The transport protocol. Supported protocols are `grpc` and `http/thrift`. |
| `.compression` | `NONE` | The compression method, see [OTEL documentation](https://opentelemetry.io/docs/reference/specification/protocol/exporter/). Supported compression methods are `gzip` and `none`. This property only takes effect when the protocol is set to `grpc`. |
| `.timeout` | `10s` | Maximum time the OTLP exporter will wait for each batch export, see [OTEL documentation](https://opentelemetry.io/docs/reference/specification/protocol/exporter/). This property only takes effect when the protocol is set to `grpc`. |

##### OTLP Exporter (Traces)

The OpenTelemetry Protocol (OTLP) exporters export the Traces in OTLP to the desired endpoint at a specified interval.
By default, the OTLP exporters are enabled but the URL endpoint needed for the exporter to actually start is set to `null`.

The following properties are nested properties below the `inspectit.exporters.tracing.otlp` property:

| Property | Default | Description |
|----------------|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `.enabled` | `IF_CONFIGURED` | If `ENABLED` or `IF_CONFIGURED`, the inspectIT Ocelot agent will try to start the OTLP gRPC trace exporter. |
| `.endpoint` | `null` | Target to which the exporter is going to send traces, e.g. `http://localhost:4317` |
| `.protocol` | `grpc` | The transport protocol, see [OTEL documentation](https://opentelemetry.io/docs/reference/specification/protocol/exporter/). Supported protocols are `grpc` and `http/protobuf`. |
| `.headers` | `null` | Key-value pairs to be used as headers associated with gRPC or HTTP requests, see [OTEL documentation](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md). |
| `.compression` | `NONE` | The compression method, see [OTEL documentation](https://opentelemetry.io/docs/reference/specification/protocol/exporter/). Supported compression methods are `gzip` and `none`. |
| `.timeout` | `10s` | Maximum time the OTLP exporter will wait for each batch export, see [OTEL documentation](https://opentelemetry.io/docs/reference/specification/protocol/exporter/). |

##### Security
Currently, the EUM Server only supports a simple API token security concept. In future, additional authentication providers
will be supported.
Expand Down
28 changes: 23 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ task downloadOpenTelemetryPlugin() {
outputs.files(ext.dest)
doLast {
def f = ext.dest
new URL("https://github.com/NovatecConsulting/boomerang-opentelemetry-plugin/releases/download/$openTelemetryVersion/boomerang-opentelemetry.js")
new URL("https://github.com/NovatecConsulting/boomerang-opentelemetry-plugin/releases/download/$boomerangOpenTelemetryPluginVersion/boomerang-opentelemetry.js")
.withInputStream { i -> f.withOutputStream { it << i } }
}

Expand Down Expand Up @@ -124,9 +124,15 @@ dependencies {
"io.grpc:grpc-netty-shaded:1.36.1",
"io.grpc:grpc-protobuf:1.36.1",
"io.grpc:grpc-stub:1.36.1",
"io.opentelemetry:opentelemetry-proto:1.1.0-alpha",
"io.opentelemetry:opentelemetry-exporter-jaeger:1.1.0",
"io.opentelemetry:opentelemetry-sdk:1.1.0",
platform("io.opentelemetry:opentelemetry-bom-alpha:${openTelemetryAlphaVersion}"),
"io.opentelemetry:opentelemetry-proto",
"io.opentelemetry:opentelemetry-semconv",
platform("io.opentelemetry:opentelemetry-bom:${openTelemetryVersion}"),
"io.opentelemetry:opentelemetry-exporter-otlp",
"io.opentelemetry:opentelemetry-exporter-jaeger",
"io.opentelemetry:opentelemetry-exporter-jaeger-thrift",
"io.opentelemetry:opentelemetry-sdk",

"com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.12.5",

"com.google.protobuf:protobuf-java:3.15.7",
Expand All @@ -139,6 +145,7 @@ dependencies {
'commons-io:commons-io:2.11.0',
"org.influxdb:influxdb-java:2.15",
"rocks.inspectit:opencensus-influxdb-exporter:1.2",

)

compileOnly "org.projectlombok:lombok:${lombokVersion}"
Expand All @@ -155,7 +162,18 @@ dependencies {
'org.awaitility:awaitility:3.1.5',
'org.mockito:mockito-junit-jupiter:2.23.0',
'org.testcontainers:testcontainers:1.15.2',
'org.testcontainers:junit-jupiter:1.15.2'
'org.testcontainers:junit-jupiter:1.15.2',

// ServerExtension
'com.linecorp.armeria:armeria-junit5:1.14.1',
'com.linecorp.armeria:armeria-grpc-protocol:1.14.1',

"io.opentelemetry:opentelemetry-semconv:1.20.0-alpha",

// for docker test containers
'org.testcontainers:testcontainers:1.16.3',
'org.testcontainers:junit-jupiter:1.16.3',

)

testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.7.2"
Expand Down
5 changes: 4 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
boomerangVersion=1.737.0

# The open-telemetry-boomerang version to ship with the EUM server
openTelemetryVersion=0.25.0-5
boomerangOpenTelemetryPluginVersion=0.25.0-5

# cannot use higher version due to a conflict with swagger2 and spring boot 2.6 - see https://stackoverflow.com/a/70503395/2478009
springboot_version=2.5.6
Expand All @@ -20,3 +20,6 @@ prometheusClientVersion = 0.6.0

mockitoVersion=4.1.0
lombokVersion=1.18.22

openTelemetryVersion=1.20.0
openTelemetryAlphaVersion=1.1.0-alpha
Loading

0 comments on commit 054ad0a

Please sign in to comment.