-
Notifications
You must be signed in to change notification settings - Fork 1.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
Enable service logging options when running as windows service #7025
Enable service logging options when running as windows service #7025
Conversation
When running as a windows service, the collector's logger zapcore.Core is replaced by a customized zapcore.Core that writes the logs to the EventViewer ignoring what is configured in the yaml. Instead of replacing it, the PR creates a Tee that preserves the original Core and its configuration, and adds the customized Core for EventViewer. This way logs are duplicated and flushed by both Cores.
|
Trying to keep the API closer to some standard libraries like FlagsSet. If a getter is needed we should name it Lookup. Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com> Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
* Feat: add httpsprovider component Add the httpsprovider component that allows the collector to fetch configuration from a web server using the https protocol. Signed-off-by: Raphael Silva <rapphil@gmail.com> * Add httpsprovider to the list of config providers Signed-off-by: Raphael Silva <rapphil@gmail.com> * Update README Signed-off-by: Raphael Silva <rapphil@gmail.com> * Apply suggestions from code review Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com> * Improve unit tests Improve unit tests to check for error while parsing test URL. Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com> * Fix comments Co-authored-by: Anthony Mirabella <a9@aneurysm9.com> * Fix comments Co-authored-by: Anthony Mirabella <a9@aneurysm9.com> * Use SchemeType instead of TransportType Signed-off-by: Raphael Silva <rapphil@gmail.com> * Refactor to improve readability Signed-off-by: Raphael Silva <rapphil@gmail.com> * Use consts from http to set http status code Signed-off-by: Raphael Silva <rapphil@gmail.com> * Refactor code organization Signed-off-by: Raphael Silva <rapphil@gmail.com> * Use struct with zero initialized properties Signed-off-by: Raphael Silva <rapphil@gmail.com> Signed-off-by: Raphael Silva <rapphil@gmail.com> Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com> Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com> Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
…y#7027) Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com> Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
…elemetry#7034) Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
This repo does not use ghr. Signed-off-by: Alex Boten <aboten@lightstep.com> Signed-off-by: Alex Boten <aboten@lightstep.com>
Signed-off-by: Alex Boten <aboten@lightstep.com> Signed-off-by: Alex Boten <aboten@lightstep.com>
Once open-telemetry/opentelemetry-collector-contrib#18057 is merged, this PR will update the documentation around releasing contrib. Signed-off-by: Alex Boten <aboten@lightstep.com> Signed-off-by: Alex Boten <aboten@lightstep.com>
Similar to FlagSet.Lookup where return pointers, clarifies that nil when error instead of invalid instance. This is not breaking change since this API was added in this version. Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com> Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
…y#7041) Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com> Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
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.
Will the existing testsuite for windows (https://github.com/open-telemetry/opentelemetry-collector/blob/main/.github/workflows/build-and-test-windows.yaml) be enough coverage to ensure this test solves part of the issue described?
Gaps in windows testing for this repo has historically caused problems.
@bogdandrutu if you're ok with it, I'd like to do the next release to ensure the changes to the release process I've made work. Signed-off-by: Alex Boten <aboten@lightstep.com>
…ation (open-telemetry#7029) Fixes open-telemetry#6966 Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
…r `retry_on_failure` (open-telemetry#7017) * Allow configuration of fields, RandomizationFactor and Multiplier, for `retry_on_failure` * changelog entry
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
…ry#7074) Bump go.opentelemetry.io/otel from 1.11.2 to 1.12.0 Bump go.opentelemetry.io/otel from 1.11.2 to 1.12.0 in /processor/batchprocessor Bump go.opentelemetry.io/otel/exporters/prometheus from 0.34.0 to 0.35.0 Bump go.opentelemetry.io/otel/exporters/prometheus from 0.34.0 to 0.35.0 in /processor/batchprocessor Bump go.opentelemetry.io/otel/metric from 0.34.0 to 0.35.0 Bump go.opentelemetry.io/otel/metric from 0.34.0 to 0.35.0 in /component Bump go.opentelemetry.io/otel/metric from 0.34.0 to 0.35.0 in /processor/batchprocessor Bump go.opentelemetry.io/otel/sdk from 1.11.2 to 1.12.0 in /extension/zpagesextension Bump go.opentelemetry.io/otel/sdk from 1.11.2 to 1.12.0 in /processor/batchprocessor Bump go.opentelemetry.io/otel/sdk/metric from 0.34.0 to 0.35.0 in /processor/batchprocessor Bump go.opentelemetry.io/otel/trace from 1.11.2 to 1.12.0 Bump go.opentelemetry.io/otel/trace from 1.11.2 to 1.12.0 in /component Bump go.opentelemetry.io/otel/trace from 1.11.2 to 1.12.0 in /extension/zpagesextension Bump google.golang.org/grpc from 1.52.0 to 1.52.3 Bump google.golang.org/grpc from 1.52.0 to 1.52.3 in /exporter/otlpexporter Bump google.golang.org/grpc from 1.52.0 to 1.52.3 in /exporter/otlphttpexporter Bump google.golang.org/grpc from 1.52.0 to 1.52.3 in /pdata Bump google.golang.org/grpc from 1.52.0 to 1.52.3 in /receiver/otlpreceiver --------- Signed-off-by: Alex Boten <aboten@lightstep.com> Co-authored-by: Alex Boten <aboten@lightstep.com>
…y#7032) * Document ability to use config providers inside config Fixes open-telemetry#6748 Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de> * s/file/provider/ Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de> * Move to its own heading Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de> --------- Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
…y#7081) This change simplifies the generated pdata code to not wrap orig fields in the internal package for structs that are not being used by other packages. The code generator is adjusted to generate wrapped or unwrapped code for only for structs that need it based on the package name. The only exception is `Slice` struct that was pulled from the generator because: - We don't have and don't expect to have any new slices that are used by other packages. - The `Slice` struct have two additional methods `AsRaw` and `FromRaw` that are not generated and defined in a separate file which is a bit confusing.
…n-telemetry#7082) Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
The previous change only modified the PR comment, instead of the call to `chlog-update` itself. Signed-off-by: Alex Boten <aboten@lightstep.com>
…pen-telemetry#7148) Not breaking change, not released yet. Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
- Changelog update 0.71.0/1.0.0-rc5 - prepare release 1.0.0-rc5 - Prepare stable for version v1.0.0-rc5 - add multimod changes 1.0.0-rc5 - prepare release 0.71.0 - Prepare beta for version v0.71.0 - add multimod changes 0.71.0
….20 (open-telemetry#7151) * remove go 1.18 support, bump minimum to go 1.19 and add testing for 1.20 Signed-off-by: Alex Boten <aboten@lightstep.com> * update chlog Signed-off-by: Alex Boten <aboten@lightstep.com> * add quotes Signed-off-by: Alex Boten <aboten@lightstep.com> --------- Signed-off-by: Alex Boten <aboten@lightstep.com>
…etry#7166) It wasn't picked up because of the `.yml` (not `.yaml`) extension.
)" (open-telemetry#7142)" (open-telemetry#7145) This reverts commit f7af599.
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Bump go.opentelemetry.io/build-tools/checkdoc from 0.5.0 to 0.6.0 in /internal/tools Bump go.opentelemetry.io/build-tools/chloggen from 0.5.0 to 0.6.0 in /internal/tools Bump go.opentelemetry.io/build-tools/crosslink from 0.5.0 to 0.6.0 in /internal/tools Bump go.opentelemetry.io/build-tools/multimod from 0.5.0 to 0.6.0 in /internal/tools Bump go.opentelemetry.io/build-tools/semconvgen from 0.5.0 to 0.6.0 in /internal/tools Bump golang.org/x/net from 0.5.0 to 0.6.0 Bump golang.org/x/sys from 0.4.0 to 0.5.0 Bump golang.org/x/sys from 0.4.0 to 0.5.0 in /cmd/otelcorecol Bump golang.org/x/sys from 0.4.0 to 0.5.0 in /exporter/loggingexporter Bump google.golang.org/grpc from 1.52.3 to 1.53.0 Bump google.golang.org/grpc from 1.52.3 to 1.53.0 in /exporter/otlpexporter Bump google.golang.org/grpc from 1.52.3 to 1.53.0 in /exporter/otlphttpexporter Bump google.golang.org/grpc from 1.52.3 to 1.53.0 in /pdata Bump google.golang.org/grpc from 1.52.3 to 1.53.0 in /receiver/otlpreceiver
Signed-off-by: Benedikt Bongartz <bongartz@klimlive.de>
@codeboten From my understanding, there is not specific test suite for windows. The workflow you references just runs the tests on a windows container. I only found 1 windows-specific test that tests the service change of status. In this PR case, it would require mocking the event viewer somehow and change the code to make stuff public in order to mock it. I'm not well-versed in the golang ways so let me know if I could improve it somehow. |
Signed-off-by: Benedikt Bongartz <bongartz@klimlive.de>
When running as a windows service, the collector's logger zapcore.Core is replaced by a customized zapcore.Core that writes the logs to the EventViewer ignoring what is configured in the yaml. Instead of replacing it, the PR creates a Tee that preserves the original Core and its configuration, and adds the customized Core for EventViewer. This way logs are duplicated and flushed by both Cores.
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #7025 +/- ##
==========================================
+ Coverage 90.36% 90.99% +0.63%
==========================================
Files 243 293 +50
Lines 14598 14271 -327
==========================================
- Hits 13191 12986 -205
+ Misses 1138 1017 -121
+ Partials 269 268 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
Description:
This PR partially addresses the issues described in #5300.
When running as a windows service, the collector's logger zapcore.Core is replaced by a customized zapcore.Core that writes the logs to the EventViewer ignoring what is configured in the yaml.
Instead of replacing it, the PR creates a Tee that preserves the original Core and its configuration, and adds the customized Core for EventViewer.
This way logs are duplicated and flushed by both Cores.
Since there isn't a specific
telemetry
configuration for windows the logging level is shared between both Cores.As an example the following configuration:
Would enable logs with a level equal or bigger to
warn
to be sent to EventViewer and the fileotel-collector.log
This partially addresses this issue.
Link to tracking Issue:
Testing: