-
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
Add 'debug' exporter #7773
Closed
Closed
Add 'debug' exporter #7773
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
89b8346
[wip] prototype debug exporter
b785168
more prototyping
4d578dd
revert changes to use NewFactoryWithName
e8ac308
add debugexporter
21db3ba
add deprecation notices to logging exporter
fb9f9f6
update documentation
fe15c5c
update factory name
65cf09a
tidy
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
change_type: new_component | ||
|
||
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) | ||
component: debugexporter | ||
|
||
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
note: Add debug exporter, which replaces the logging exporter | ||
|
||
# One or more tracking issues or pull requests related to the change | ||
issues: [7769] | ||
|
||
# (Optional) One or more lines of additional information to render under the primary note. | ||
# These lines will be padded with 2 spaces and then inserted directly into the document. | ||
# Use pipe (|) for multiline entries. | ||
subtext: |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
change_type: deprecation | ||
|
||
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) | ||
component: loggingexporter | ||
|
||
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
note: Mark the logging exporter as deprecated, in favour of debug exporter | ||
|
||
# One or more tracking issues or pull requests related to the change | ||
issues: [7769] | ||
|
||
# (Optional) One or more lines of additional information to render under the primary note. | ||
# These lines will be padded with 2 spaces and then inserted directly into the document. | ||
# Use pipe (|) for multiline entries. | ||
subtext: |
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
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
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
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
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,13 +76,13 @@ receivers: | |
regex: '.*grpc_io.*' | ||
action: drop | ||
exporters: | ||
logging: | ||
debug: | ||
service: | ||
pipelines: | ||
metrics: | ||
receivers: [prometheus] | ||
processors: [] | ||
exporters: [logging] | ||
exporters: [debug] | ||
``` | ||
|
||
### zPages | ||
|
@@ -109,21 +109,21 @@ extensions: | |
exporters](https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter#general-information) | ||
can be configured to inspect the data being processed by the Collector. | ||
|
||
For live troubleshooting purposes consider leveraging the `logging` exporter, | ||
For live troubleshooting purposes consider leveraging the `debug` exporter, | ||
which can be used to confirm that data is being received, processed and | ||
exported by the Collector. | ||
|
||
```yaml | ||
receivers: | ||
zipkin: | ||
exporters: | ||
logging: | ||
debug: | ||
service: | ||
pipelines: | ||
traces: | ||
receivers: [zipkin] | ||
processors: [] | ||
exporters: [logging] | ||
exporters: [debug] | ||
``` | ||
|
||
Get a Zipkin payload to test. For example create a file called `trace.json` | ||
|
@@ -161,21 +161,21 @@ $ curl -X POST localhost:9411/api/v2/spans -H'Content-Type: application/json' -d | |
You should see a log entry like the following from the Collector: | ||
|
||
``` | ||
2020-11-11T04:12:33.089Z INFO loggingexporter/logging_exporter.go:296 TraceExporter {"#spans": 1} | ||
2020-11-11T04:12:33.089Z INFO debugexporter/debug_exporter.go:296 TraceExporter {"#spans": 1} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Call me paranoid, but can you bump the date to a date closer to today? It might be just me, but I would be really confused seeing this timestamp and no versions of the collector around that date having this component. |
||
``` | ||
|
||
You can also configure the `logging` exporter so the entire payload is printed: | ||
You can also configure the `debug` exporter so the entire payload is printed: | ||
|
||
```yaml | ||
exporters: | ||
logging: | ||
debug: | ||
verbosity: detailed | ||
``` | ||
|
||
With the modified configuration if you re-run the test above the log output should look like: | ||
|
||
``` | ||
2020-11-11T04:08:17.344Z DEBUG loggingexporter/logging_exporter.go:353 ResourceSpans #0 | ||
2020-11-11T04:08:17.344Z DEBUG debugexporter/debug_exporter.go:353 ResourceSpans #0 | ||
Resource labels: | ||
-> service.name: Str(api) | ||
ScopeSpans #0 | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include ../../Makefile.Common |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Debug Exporter | ||
|
||
| Status | | | ||
| ------------------------ |-----------------------| | ||
| Stability | [Development] | | ||
| Supported pipeline types | traces, metrics, logs | | ||
| Distributions | [core], [contrib] | | ||
|
||
Exports data to the console via zap.Logger. | ||
|
||
Supported pipeline types: traces, metrics, logs | ||
|
||
## Getting Started | ||
|
||
The following settings are optional: | ||
|
||
- `verbosity` (default = `normal`): the verbosity of the logging export | ||
(detailed|normal|basic). When set to `detailed`, pipeline data is verbosely | ||
logged. | ||
- `sampling_initial` (default = `2`): number of messages initially logged each | ||
second. | ||
- `sampling_thereafter` (default = `500`): sampling rate after the initial | ||
messages are logged (every Mth message is logged). Refer to [Zap | ||
docs](https://godoc.org/go.uber.org/zap/zapcore#NewSampler) for more details. | ||
on how sampling parameters impact number of messages. | ||
|
||
Example: | ||
|
||
```yaml | ||
exporters: | ||
debug: | ||
verbosity: detailed | ||
sampling_initial: 5 | ||
sampling_thereafter: 200 | ||
``` | ||
|
||
[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib | ||
[core]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol | ||
[Development]: https://github.com/open-telemetry/opentelemetry-collector#in-development |
Oops, something went wrong.
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.
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.
Why this change?
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.
i ran
make gotidy
and this happened