You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Confirmed emit does not seem to default timestamp. This also means that trying to export that LogRecord to console fails because it cannot format timestamp. LogRecord.to_json() does not expect None. EX:
Looking into include_trace_context, it does not seem python has this to begin with. LoggingHandler.emit calls LoggingHandler._translate which uses get_current_span().get_span_context(). This may be an optional feature for if we want people to be able to EXPLICATELY set the context of a logger.
Related question: should a log's trace context fields be populated if include_trace_context=false and context is explicitly passed? I think yes. However, for languages that rely on explicit context because no implicit context is available, there's no point to having the include_trace_context parameter since it doesn't change any behavior https://github.com/open-telemetry/opentelemetry-specification/pull/3387/files
Perhaps it would be worth including a fix for #3353 before stabilizing. This might not technically be a breaking change but it does significantly change the messages received
Activity
jeremydvoss commentedon Jun 27, 2023
For log records, here are some initial links:
https://github.com/open-telemetry/opentelemetry-python/blob/main/opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py#L492
https://github.com/open-telemetry/opentelemetry-python/blob/main/opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py#L530
Need to confirm logData does no defaulting.
jeremydvoss commentedon Jun 28, 2023
Confirmed emit does not seem to default timestamp. This also means that trying to export that LogRecord to console fails because it cannot format timestamp. LogRecord.to_json() does not expect None. EX:
jeremydvoss commentedon Jun 28, 2023
Looking into include_trace_context, it does not seem python has this to begin with. LoggingHandler.emit calls LoggingHandler._translate which uses
get_current_span().get_span_context(). This may be an optional feature for if we want people to be able to EXPLICATELY set the context of a logger.Related question: should a log's trace context fields be populated if include_trace_context=false and context is explicitly passed? I think yes. However, for languages that rely on explicit context because no implicit context is available, there's no point to having the include_trace_context parameter since it doesn't change any behaviorhttps://github.com/open-telemetry/opentelemetry-specification/pull/3387/files
jeremydvoss commentedon Jun 28, 2023
Here is the observed_timestamp field
jeremydvoss commentedon Jun 28, 2023
Seems we are NOT defaulting observed_timestamp to current time. We could change this in the sdk...
... or in the api:
I am getting
int(time.time() * 1e9)from how to translate native logsjeremydvoss commentedon Jun 29, 2023
Use time.time_ns()
jenshnielsen commentedon Jul 6, 2023
Perhaps it would be worth including a fix for #3353 before stabilizing. This might not technically be a breaking change but it does significantly change the messages received
lzchen commentedon Jul 6, 2023
@jenshnielsen
I don't believe the issue exists within the SDK itself so it wouldn't be a blocker.
lzchen commentedon Sep 25, 2023
Might be another issue: #3193
jeremydvoss commentedon Feb 1, 2024
Take a look at #3608
jeremydvoss commentedon Apr 11, 2024
Take a look at #3810