-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[service] add logger provider configuration support #10544
base: main
Are you sure you want to change the base?
[service] add logger provider configuration support #10544
Conversation
While I think the ability to directly configure the destination of collector logs in the telemetry section might be cool for small and simple configurations in certain environments where you can not simply pick up your looks using Something like this: exporter:
otlp/honeycomb:
protocol: http/protobuf
endpoint: https://api.honeycomb.io:443
headers:
"x-honeycomb-team": "${env:HONEYCOMB_API_KEY}"
pipeline:
telemetry:
metrics:
verbosity: detailed
pipelines: [logs/collector]
logs:
verbosity: detailed
pipelines: [logs/collector]
logs/collector:
receivers: [telemetry/logs]
processors: [batch]
exporters: [otlp/honeycomb]
metrics/collector:
receivers: [telemetry/metrics]
processors: [batch]
exporters: [otlp/honeycomb]
traces/collector:
... Compared to: telemetry:
logs:
processors:
- batch:
exporter:
otlp:
protocol: http/protobuf
endpoint: https://api.honeycomb.io:443
headers:
"x-honeycomb-team": "${env:HONEYCOMB_API_KEY}"
metrics:
processors:
- batch:
exporter:
otlp:
protocol: http/protobuf
endpoint: https://api.honeycomb.io:443
headers:
"x-honeycomb-team": "${env:HONEYCOMB_API_KEY}"
traces:
... wdyt? |
@frzifus there was a decision made some time ago (i'm struggling to find a link with this info) to not pipe the collector's own telemetry through itself, to avoid the scenario of the collector's own telemetry being interrupted by an overloaded collector. This is why I'm proposing supporting the logging provider directly. Are you thinking of the scenario where you'd like to be able to apply some transformations to the logs? |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
d8f5ce0
to
d0e3509
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10544 +/- ##
==========================================
- Coverage 92.14% 92.08% -0.06%
==========================================
Files 432 432
Lines 20293 20309 +16
==========================================
+ Hits 18699 18702 +3
- Misses 1230 1243 +13
Partials 364 364 ☔ View full report in Codecov by Sentry. |
4d01082
to
3ad3a90
Compare
44aa182
to
09a60e5
Compare
@open-telemetry/collector-approvers this PR should be ready for review |
return nil, err | ||
} | ||
logger = logger.WithOptions(zap.WrapCore(func(_ zapcore.Core) zapcore.Core { | ||
return otelzap.NewCore("go.opentelemetry.io/collector/service/telemetry", otelzap.WithLoggerProvider(sdk.LoggerProvider())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you reach this point, I believe we are ignoring many of the existing options in the service::telemetry::logs
section (e.g. output paths for sure, I wonder about some of the other options we already support). I think we should fail if said options are set and force the user to pick whether they want to use the processors
section or the other options.
This allows us to use the otel-go/config package to support configuring external destinations for logs. I'm putting this in draft to gather community feedback on whether this is a desirable feature for the collector. Signed-off-by: Alex Boten <[email protected]>
Signed-off-by: Alex Boten <[email protected]>
Signed-off-by: Alex Boten <[email protected]>
Signed-off-by: Alex Boten <[email protected]>
Signed-off-by: Alex Boten <[email protected]>
Signed-off-by: Alex Boten <[email protected]>
Signed-off-by: Alex Boten <[email protected]>
Signed-off-by: Alex Boten <[email protected]>
Signed-off-by: Alex Boten <[email protected]>
766208b
to
dc5df50
Compare
This allows us to use the otel-go/config package to support configuring external destinations for logs. I'm putting this in draft to gather community feedback on whether this is a desirable feature for the collector.
I used the following configuration with this PR to send data to an OTLP backend:
This allowed me to see logs in my backend: