Files
telemetry/otelcol/testdata/otelcol-log-to-file.yaml
Braydon KainsandGitHub d13e62d925 otelcol: fix windows event log core placement (#11051)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
In the CollectorSettings LoggingOptions, when the options are
`zap.WrapCore`, the final core wrapped will end up running first. For
this reason, the windowsEventLogCore must be the first option in the
list of user supplied options, to ensure user supplied options are run
before the core that writes to the Windows Event Log.

Prior art: I fixed this before in #5298.

<!-- Issue number if applicable -->
#### Link to tracking issue
#5297 

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Testing was manual by running the Collector as a service after this
change. I tried to add a unit test but could not find an effective way
to do that due to all the type indirection done by the `zap` package. I
was hoping to find an easy way to tell that the `windowsEventLogCore` is
the first core wrapped in the options but I could not find a way to pull
that off. Open to ideas if anyone can find a way.
2024-09-16 11:36:51 +02:00

31 lines
496 B
YAML

extensions:
zpages:
receivers:
otlp:
protocols:
grpc:
http:
exporters:
debug:
verbosity: detailed
service:
telemetry:
logs:
level: info
output_paths:
# The folder need to be created prior to starting the collector
- ${ProgramData}\OpenTelemetry\Collector\Logs\otelcol.log
pipelines:
traces:
receivers: [otlp]
exporters: [debug]
metrics:
receivers: [otlp]
exporters: [debug]
extensions: [zpages]