-
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
Reuse add_metadata_from_filepath #33912
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
add_metadata_from_filepath is tied to the container operator for the reason that it's specific for the target technology: container logs from known runtimes which are written to known log file paths (usually that's the case but that's not guaranteed, that's why this is an optional setting which can be disabled). So generalizing this, as is, for the entire file consumer sounds a bit weird unless we explicitly name it to something like Btw, how the log entries look like after they are parsed? I guess they are not wrapped in a container format, right? |
How would you feel about adding |
you mean for OTLP JSON File Receiver? There, they are wrapped in a container format - I've created #33846 to deal with that |
How about a |
sound good 😄 what is pod type and what are possible values? |
Sorry, not the correct name. Maybe I was thinking it would behave the same as the |
I like the idea of the path parser. I think that with some refactoring we could re-use what the Regarding scope/naming: the Then as far as the config option is concerned, I don't think that the
As it was already mentioned the type can be detected in I don't have any strong preference on the naming here, I would just suggest |
great I tried to add the functionality to
type FieldEntry struct {
Key FieldInterface
Value any
} ideas? |
I don't think this is what we were suggesting. The idea for adding a new parser means a new operator which is independent of |
OK - should operators be supported by json otlp receiver then? |
Interesting, for some reason I took for granted that operators are also part of the On the other hand I'm not sure if we could do sth similar to the Header operators which are part of fileconsumer: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/pkg/stanza/fileconsumer/config.go#L94 Based on the above I wonder if this specific feature should come through an |
I forgot that operators are not supported in this receiver, but it makes sense really. The purpose of the receiver is to read in fully formatted telemetry data. It's just a mechanism for transmission really. With that in mind, I don't care if this functionality is implemented as an operator, but I do think it should happen outside of fileconsumer. It would make sense to me as a reuseable function or package shared by the container parser and this, and perhaps later a container path parser. |
@djaglowski @zeitlinger shall we close this one? That was mostly needed for #33846 but I think that should also be fine now after the |
Closing since #33846 was also closed. We can re-open if there is a specific use-case for this. |
yes, the current solution is much better 😄 |
Component(s)
pkg/stanza, receiver/filelog
Is your feature request related to a problem? Please describe.
add_metadata_from_filepath is tied to the container operator.
Describe the solution you'd like
Would it make sense to move this feature to file consumer, so that it can be reused, e.g. in OTLP JSON File Receiver?
Describe alternatives you've considered
Could be done manually - if operators were supported for OTLP JSON File Receiver:
Additional context
No response
The text was updated successfully, but these errors were encountered: