-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[connector/otlpjson] Add connector's implementations #34249
Merged
djaglowski
merged 1 commit into
open-telemetry:main
from
ChrsMark:implement_oltpjson_connector
Jul 25, 2024
Merged
[connector/otlpjson] Add connector's implementations #34249
djaglowski
merged 1 commit into
open-telemetry:main
from
ChrsMark:implement_oltpjson_connector
Jul 25, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
ChrsMark
force-pushed
the
implement_oltpjson_connector
branch
from
July 25, 2024 11:02
6afe625
to
1b525bc
Compare
How to test this manually
dist:
name: otelcol-dev-bin
description: Basic OpenTelemetry collector distribution for Developers
output_path: ./otelcol-dev
otelcol_version: 0.105.0
exporters:
- gomod: go.opentelemetry.io/collector/exporter/debugexporter v0.105.0
receivers:
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.105.0
connectors:
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/connector/otlpjsonconnector v0.105.0
replaces:
- github.com/open-telemetry/opentelemetry-collector-contrib/connector/otlpjsonconnector => ~/go/src/github.com/open-telemetry/opentelemetry-collector-contrib/connector/otlpjsonconnector
receivers:
filelog:
include:
- /var/log/pods/prod_my-target-pod_49cc7c1fd3702c40b2686ea7486091d3/my-target-pod/1.log
exporters:
debug:
verbosity: detailed
connectors:
otlpjson:
service:
pipelines:
logs/raw:
receivers: [filelog]
exporters: [otlpjson]
metrics/otlp:
receivers: [ otlpjson ]
exporters: [ debug ]
logs/otlp:
receivers: [ otlpjson ]
exporters: [ debug ]
traces/otlp:
receivers: [ otlpjson ]
exporters: [ debug ]
> echo '{"resourceSpans":[{"resource":{"attributes":[{"key":"resource-attr","value":{"stringValue":"resource-attr-val-1"}}]},"scopeSpans":[{"scope":{},"spans":[{"traceId":"","spanId":"","parentSpanId":"","name":"operationA","startTimeUnixNano":"1581452772000000321","endTimeUnixNano":"1581452773000000789","droppedAttributesCount":1,"events":[{"timeUnixNano":"1581452773000000123","name":"event-with-attr","attributes":[{"key":"span-event-attr","value":{"stringValue":"span-event-attr-val"}}],"droppedAttributesCount":2},{"timeUnixNano":"1581452773000000123","name":"event","droppedAttributesCount":2}],"droppedEventsCount":1,"status":{"message":"status-cancelled","code":2}},{"traceId":"","spanId":"","parentSpanId":"","name":"operationB","startTimeUnixNano":"1581452772000000321","endTimeUnixNano":"1581452773000000789","links":[{"traceId":"","spanId":"","attributes":[{"key":"span-link-attr","value":{"stringValue":"span-link-attr-val"}}],"droppedAttributesCount":4},{"traceId":"","spanId":"","droppedAttributesCount":1}],"droppedLinksCount":3,"status":{}}]}]}]}' >> /var/log/pods/prod_my-target-pod_49cc7c1fd3702c40b2686ea7486091d3/my-target-pod/1.log
> echo '{"resourceLogs":[{"resource":{"attributes":[{"key":"resource-attr","value":{"stringValue":"resource-attr-val-1"}}]},"scopeLogs":[{"scope":{},"logRecords":[{"timeUnixNano":"1581452773000000789","severityNumber":9,"severityText":"Info","body":{"stringValue":"This is a log message"},"attributes":[{"key":"app","value":{"stringValue":"server"}},{"key":"instance_num","value":{"intValue":"1"}}],"droppedAttributesCount":1,"traceId":"08040201000000000000000000000000","spanId":"0102040800000000"},{"timeUnixNano":"1581452773000000789","severityNumber":9,"severityText":"Info","body":{"stringValue":"something happened"},"attributes":[{"key":"customer","value":{"stringValue":"acme"}},{"key":"env","value":{"stringValue":"dev"}}],"droppedAttributesCount":1,"traceId":"","spanId":""}]}]}]}' >> /var/log/pods/prod_my-target-pod_49cc7c1fd3702c40b2686ea7486091d3/my-target-pod/1.log
> echo '{"resourceMetrics":[{"resource":{"attributes":[{"key":"resource-attr","value":{"stringValue":"resource-attr-val-1"}}]},"scopeMetrics":[{"scope":{},"metrics":[{"name":"counter-int","unit":"1","sum":{"dataPoints":[{"attributes":[{"key":"label-1","value":{"stringValue":"label-value-1"}}],"startTimeUnixNano":"1581452773000000789","timeUnixNano":"1581452773000000789","asInt":"123"},{"attributes":[{"key":"label-2","value":{"stringValue":"label-value-2"}}],"startTimeUnixNano":"1581452772000000321","timeUnixNano":"1581452773000000789","asInt":"456"}],"aggregationTemporality":2,"isMonotonic":true}},{"name":"counter-int","unit":"1","sum":{"dataPoints":[{"attributes":[{"key":"label-1","value":{"stringValue":"label-value-1"}}],"startTimeUnixNano":"1581452772000000321","timeUnixNano":"1581452773000000789","asInt":"123"},{"attributes":[{"key":"label-2","value":{"stringValue":"label-value-2"}}],"startTimeUnixNano":"1581452772000000321","timeUnixNano":"1581452773000000789","asInt":"456"}],"aggregationTemporality":2,"isMonotonic":true}}]}]}]}' >> /var/log/pods/prod_my-target-pod_49cc7c1fd3702c40b2686ea7486091d3/my-target-pod/1.log
|
djaglowski
approved these changes
Jul 25, 2024
djaglowski
pushed a commit
that referenced
this pull request
Jul 26, 2024
**Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> This is the 3rd PR for the new otlpjson connector (#34208). Moves its stability to `alpha`. **Link to tracking Issue:** <Issue number if applicable> #34208 #34239 #34249 **Testing:** <Describe what testing was performed and which tests were added.> ~ **Documentation:** <Describe the documentation added.> Updated --------- Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
This is the 2nd PR for the new
otlpjson
connector (#34208). Adds theConsumeLogs
methods for the logs, metrics and traces respective connector types.At the moment, the connector retrieves the otlp json from the incoming Log's
Body
. This is not configurable yet. It can be decided if that needs to be.In addition, there is no attribute/metadata extraction/transfer from the incoming Log. This can be added in future iterations.
Link to tracking Issue: #34208 #34239
Testing: Added.
Documentation: ~