Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INFOPLAT-1575 Implement Prometheus to OTel metrics conversion #1013

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

pkcll
Copy link
Contributor

@pkcll pkcll commented Jan 28, 2025

Implement Prometheus to OTel metrics conversion and export.

Receiver:

Exporter:

  • Wraps otlpexporter
  • Receives metric data from the receiver
  • Export OTel metrics data to otel collector endpoint via otlpexporter

Dependency PR's

Run Example

cd chainlink-common/pkg/promotel

# start otel-collector
docker run \
 -p 127.0.0.1:4317:4317 \
 -p 127.0.0.1:4318:4318 \
 -p 127.0.0.1:55679:55679 \
 otel/opentelemetry-collector-contrib:0.117.0

# run example
make run-example

Example app output

...
   INFO    cmd/example.go:34       Reported Prometheus metric      {"name": "test_counter_metric", "value": 7}
   INFO    cmd/example.go:48       Received Prometheus metric      {"name": "test_counter_metric", "value": 7}
   INFO    cmd/example.go:138      Exporting OTel metric   {"name": "test_counter_metric", "value": 7}
...

otel-collector-agent logs

otelcollectoragent  | Metric #27
otelcollectoragent  | Descriptor:
otelcollectoragent  |      -> Name: test_counter_metric
otelcollectoragent  |      -> Description:
otelcollectoragent  |      -> Unit:
otelcollectoragent  |      -> DataType: Sum
otelcollectoragent  |      -> IsMonotonic: true
otelcollectoragent  |      -> AggregationTemporality: Cumulative
otelcollectoragent  | NumberDataPoints #0
otelcollectoragent  | Data point attributes:
otelcollectoragent  |      -> app: Str(promotel-demo)
otelcollectoragent  | StartTimestamp: ...
otelcollectoragent  | Timestamp: ...
otelcollectoragent  | Value: 7.000000

@pkcll pkcll force-pushed the INFOPLAT-1575/promotel-forked branch from 0b5d061 to f041f3f Compare February 6, 2025 02:57
@pkcll pkcll force-pushed the INFOPLAT-1575/promotel-forked branch from f041f3f to b2e263e Compare February 6, 2025 03:04
@pkcll pkcll force-pushed the INFOPLAT-1575/promotel-forked branch from 82ad449 to f0f83de Compare February 6, 2025 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant