-
Notifications
You must be signed in to change notification settings - Fork 2.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
[datasetexporter]: Upgrade library to 0.17.0 #29446
[datasetexporter]: Upgrade library to 0.17.0 #29446
Conversation
I'm worried that these metrics don't look like other metrics exposed by other components of the collector: $ curl localhost:8888/metrics
# HELP otelcol_dataset_eventsEnqueued
# TYPE otelcol_dataset_eventsEnqueued gauge
otelcol_dataset_eventsEnqueued 31
# HELP otelcol_dataset_eventsProcessed
# TYPE otelcol_dataset_eventsProcessed gauge
otelcol_dataset_eventsProcessed 31
(...)
I wasn't able to find any guidelines on defining metrics in components, but looking at other components' metrics, I think the metrics from the DataSet exporter should have the names e.g.:
|
Co-authored-by: Andrzej Stencel <astencel@sumologic.com>
Co-authored-by: Andrzej Stencel <astencel@sumologic.com>
Co-authored-by: Andrzej Stencel <astencel@sumologic.com>
Thanks for the review. From the name - I will solve it differently and introduce those attributes. |
@astencel-sumo : I have updated the library - scalyr/dataset-go#63. I have also updated some screenshots in the description to show the functionality. |
|
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.
Change looks good, just one question
exporter/datasetexporter/config.go
Outdated
@@ -182,14 +186,15 @@ func (c *Config) Validate() error { | |||
func (c *Config) String() string { | |||
s := "" | |||
s += fmt.Sprintf("%s: %s; ", "DatasetURL", c.DatasetURL) | |||
s += fmt.Sprintf("%s: %s (%d); ", "APIKey", strings.Repeat("*", len(c.APIKey)), len(c.APIKey)) |
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.
a configopaque.String will by default be replaced with [Redacted]
, is there a reason to override the behaviour here?
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.
@codeboten : Thanks. But when I have tried it out - it's returning the real value. I have to use apiKey, _ := c.APIKey.MarshalText()
- which is not too much better. I will replace it, so it's more consistent with other places.
--- FAIL: TestConfigString (0.00s)
config_test.go:143:
Error Trace: /Users/martin.majlis/development/scalyr-org/opentelemetry-collector-contrib/exporter/datasetexporter/config_test.go:143
Error: Not equal:
expected: "DatasetURL: https://example.com; APIKey: ****** (6); Debug: true; BufferSettings: {MaxLifetime:123ns GroupBy:[field1 field2] RetryInitialInterval:0s RetryMaxInterval:0s RetryMaxElapsedTime:0s RetryShutdownTimeout:0s}; LogsSettings: {ExportResourceInfo:true ExportResourcePrefix:AAA ExportScopeInfo:true ExportScopePrefix:BBB DecomposeComplexMessageField:true DecomposedComplexMessagePrefix:EEE exportSettings:{ExportSeparator:CCC ExportDistinguishingSuffix:DDD}}; TracesSettings: {exportSettings:{ExportSeparator:TTT ExportDistinguishingSuffix:UUU}}; ServerHostSettings: {UseHostName:false ServerHost:foo-bar}; RetrySettings: {Enabled:true InitialInterval:5s RandomizationFactor:0.5 Multiplier:1.5 MaxInterval:30s MaxElapsedTime:5m0s}; QueueSettings: {Enabled:true NumConsumers:10 QueueSize:1000 StorageID:<nil>}; TimeoutSettings: {Timeout:5s}"
actual : "DatasetURL: https://example.com; APIKey: secret (6); Debug: true; BufferSettings: {MaxLifetime:123ns GroupBy:[field1 field2] RetryInitialInterval:0s RetryMaxInterval:0s RetryMaxElapsedTime:0s RetryShutdownTimeout:0s}; LogsSettings: {ExportResourceInfo:true ExportResourcePrefix:AAA ExportScopeInfo:true ExportScopePrefix:BBB DecomposeComplexMessageField:true DecomposedComplexMessagePrefix:EEE exportSettings:{ExportSeparator:CCC ExportDistinguishingSuffix:DDD}}; TracesSettings: {exportSettings:{ExportSeparator:TTT ExportDistinguishingSuffix:UUU}}; ServerHostSettings: {UseHostName:false ServerHost:foo-bar}; RetrySettings: {Enabled:true InitialInterval:5s RandomizationFactor:0.5 Multiplier:1.5 MaxInterval:30s MaxElapsedTime:5m0s}; QueueSettings: {Enabled:true NumConsumers:10 QueueSize:1000 StorageID:<nil>}; TimeoutSettings: {Timeout:5s}"
Diff:
--- Expected
+++ Actual
@@ -1 +1 @@
-DatasetURL: https://example.com; APIKey: ****** (6); Debug: true; BufferSettings: {MaxLifetime:123ns GroupBy:[field1 field2] RetryInitialInterval:0s RetryMaxInterval:0s RetryMaxElapsedTime:0s RetryShutdownTimeout:0s}; LogsSettings: {ExportResourceInfo:true ExportResourcePrefix:AAA ExportScopeInfo:true ExportScopePrefix:BBB DecomposeComplexMessageField:true DecomposedComplexMessagePrefix:EEE exportSettings:{ExportSeparator:CCC ExportDistinguishingSuffix:DDD}}; TracesSettings: {exportSettings:{ExportSeparator:TTT ExportDistinguishingSuffix:UUU}}; ServerHostSettings: {UseHostName:false ServerHost:foo-bar}; RetrySettings: {Enabled:true InitialInterval:5s RandomizationFactor:0.5 Multiplier:1.5 MaxInterval:30s MaxElapsedTime:5m0s}; QueueSettings: {Enabled:true NumConsumers:10 QueueSize:1000 StorageID:<nil>}; TimeoutSettings: {Timeout:5s}
+DatasetURL: https://example.com; APIKey: secret (6); Debug: true; BufferSettings: {MaxLifetime:123ns GroupBy:[field1 field2] RetryInitialInterval:0s RetryMaxInterval:0s RetryMaxElapsedTime:0s RetryShutdownTimeout:0s}; LogsSettings: {ExportResourceInfo:true ExportResourcePrefix:AAA ExportScopeInfo:true ExportScopePrefix:BBB DecomposeComplexMessageField:true DecomposedComplexMessagePrefix:EEE exportSettings:{ExportSeparator:CCC ExportDistinguishingSuffix:DDD}}; TracesSettings: {exportSettings:{ExportSeparator:TTT ExportDistinguishingSuffix:UUU}}; ServerHostSettings: {UseHostName:false ServerHost:foo-bar}; RetrySettings: {Enabled:true InitialInterval:5s RandomizationFactor:0.5 Multiplier:1.5 MaxInterval:30s MaxElapsedTime:5m0s}; QueueSettings: {Enabled:true NumConsumers:10 QueueSize:1000 StorageID:<nil>}; TimeoutSettings: {Timeout:5s}
Test: TestConfigString
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.
But when I have tried it out - it's returning the real value.
This is surprising to me... maybe @mx-psi can help here. Will not block this PR on this though.
The failed test is related to k8observer:
|
This is what I'm now seeing in the metrics: otelcol_dataset_events_enqueued{entity="logs",name="ds1"} 31
otelcol_dataset_events_enqueued{entity="logs",name="ds2"} 31
otelcol_dataset_events_processed{entity="logs",name="ds1"} 31
otelcol_dataset_events_processed{entity="logs",name="ds2"} 31 This is when I have two exporters defined like this: exporters:
dataset/ds1:
api_key: abc123456
dataset_url: http://localhost:1234
dataset/ds2:
api_key: def
dataset_url: http://localhost:5678
service:
pipelines:
logs/p1:
exporters:
- dataset/ds1
- dataset/ds2 It's not ideal, but the exporter names are there in some form. If you're prepared to possibly make changes to these metrics in the future than I guess this is a step in the right direction. We should probably also make it easier for components to expose metrics in the right format, and have that documented. |
Description: Upgrade to new version of the library.
This PR is implementing following issues:
debug
option whethersession_key
is included or notOther change is that fields that are specified as part of the
group_by
configuration are now transferred as part of the session info.Link to tracking Issue: #27650, #27652
Testing:
docker-compose.yaml
and in thesrc/otelcollector/otelcol-config.yml
:docker-compose.yaml
switch image to the newly build one in step 1docker-compose.yaml
enable feature gate for collecting metrics ---feature-gates=telemetry.useOtelForInternalMetrics
src/otelcollector/otelcol-config.yml
enable metrics scraping by prometheussrc/otelcollector/otelcol-config.yml
add configuration for datasetdocker compose up --abort-on-container-exit
Documentation:
Library changes: