-
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
Scope name parsing doesn't work. #23387
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
I agree this is a problem. From what I can tell, the @bin-shi-mulesoft, thanks for reporting this. Let me know if you want to take the issue and I'll assign it to you. |
@djaglowski Sure. I can work on this. |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Facing the same issue, not sure if the root cause described above still valid or not (@djaglowski can ya confirm ?). If yes, @bin-shi-mulesoft should I go ahead and pick it up ? |
@someshkoli, my assessment of the cause is unchanged. I appreciate the help and will reassign this to you. The biggest challenge here will be to preserve performance scope is not present. Grouping by scope will potentially introduce some overhead but we should be able to optimize for the case where scope is unused. Performance benchmarks will be helpful here. You may need to evaluate if the existing benchmarks in the package are sufficient to demonstrate the difference. |
@djaglowski have benchmark numbers with me, rough implementation resourceIdx, ok := resourceHashToIdx[resourceID]
if !ok {
resourceHashToIdx[resourceID] = pLogs.ResourceLogs().Len()
rl = pLogs.ResourceLogs().AppendEmpty()
upsertToMap(e.Resource, rl.Resource().Attributes())
scopeIdxByResource[resourceID] = make(map[string]int)
scopeIdxByResource[resourceID][scopeName] = rl.ScopeLogs().Len()
sl = rl.ScopeLogs().AppendEmpty()
sl.Scope().SetName(scopeName)
} else {
rl = pLogs.ResourceLogs().At(resourceIdx)
scopesInThisResource, _ := scopeIdxByResource[resourceID]
scopeInResource, ok := scopesInThisResource[scopeName]
if !ok {
scopesInThisResource[scopeName] = rl.ScopeLogs().Len()
sl = rl.ScopeLogs().AppendEmpty()
sl.Scope().SetName(scopeName)
} else {
sl = pLogs.ResourceLogs().At(resourceIdx).ScopeLogs().At(scopeInResource)
}
} |
@someshkoli, thanks that seems reasonable. |
This groups the records by records -> scopes |
**Description:** <Describe what has changed.> Fix: #23387 Adds grouping of logrecords based on scope - adds scope grouping along with scope name - adds integration test for benchmark **Link to tracking Issue:** #23387 **Testing:** 1. Did some benchmark on this build, results below: On main branch: `BenchmarkEmitterToConsumer`: ~3.12 On my branch: `BenchmarkEmitterToConsumer`: ~3.26 on my branch: `BenchmarkEmitterToConsumerScopeGroupping` (with 2 host variation and 2 scope variation): ~4.2s 2. Added unit tests **Documentation:** <Describe the documentation added.> --------- Co-authored-by: Dan Jaglowski <[email protected]>
**Description:** <Describe what has changed.> Fix: open-telemetry#23387 Adds grouping of logrecords based on scope - adds scope grouping along with scope name - adds integration test for benchmark **Link to tracking Issue:** open-telemetry#23387 **Testing:** 1. Did some benchmark on this build, results below: On main branch: `BenchmarkEmitterToConsumer`: ~3.12 On my branch: `BenchmarkEmitterToConsumer`: ~3.26 on my branch: `BenchmarkEmitterToConsumerScopeGroupping` (with 2 host variation and 2 scope variation): ~4.2s 2. Added unit tests **Documentation:** <Describe the documentation added.> --------- Co-authored-by: Dan Jaglowski <[email protected]>
Hi @djaglowski, I want to use the observed time as a timestamp, is this possible? any hint? - type: json_parser
timestamp:
parse_from: 'observedTimeUnixNano'
layout_type: epoch
layout: ns otelcol-contrib[29061]: error decoding 'parse_from': unrecognized prefix |
Component(s)
pkg/stanza
What happened?
Description
The Scope Name Parsing doesn't add the scope name to the ScopeLog.
Steps to Reproduce
echo "com.example.Foo - some message" > /tmp/example.log
otelcol-contrib --config otel.yaml
Actual Result
Note: The output is one line, and I format it in json here for pretty looking.
Expected Result
The name of scope is set to
com.example.Foo
.Collector version
v0.79.0
Environment information
Environment
OS: macOS Version 13.4
OpenTelemetry Collector configuration
Log output
Additional context
parse_from
in the example Configuration on Scope Name Parsing page seem not right. The value should beattributes.scope_name_field
rather thanbody.scope_name_field
The text was updated successfully, but these errors were encountered: