Unsupported instrument/aggregator combo, types ValueRecorder and MinMaxSumCountAggregator, ignoring it
response_latency = meter.create_valuerecorder(
name="response_latency_python",
description="response latency",
unit="ms",
value_type=int,
)
tracer.start_span(“child”, parent=parent)
Also in the docs is written:
By default the current span will be used as parent, but an explicit parent can also be specified, either a Span or a opentelemetry.trace.SpanContext. If the specified value is None, the created span will be a root span.
# Suppose that this is in Service - 1
with tracer.start_as_current_span('service 1') as span:
span.set_attribute('module', str(inspect.getmodule(f)))
span.set_attribute('function_name', f.__name__)
span.set_attribute('function_args', f'args = {str(args)}, kwargs = {str(kwargs)}')
c: SpanContext = span.get_span_context()
# Suppose that this is in service - 2
# trace_id, span_id, is_remote, trace_flags, and trace_state need to be sent to the service 2
ctx = trace.set_span_in_context(
trace.DefaultSpan(
trace.SpanContext(
# trace an span ids are encoded in hex, so must be converted
trace_id=c.trace_id,
span_id=c.span_id,
is_remote=c.is_remote,
trace_flags=c.trace_flags,
trace_state=c.trace_state,
)
)
)
with tracer.start_span('service 2', context=ctx) as span:
span.set_attribute('module', str(inspect.getmodule(f)))
span.set_attribute('function_name', f.__name__)
span.set_attribute('my new stuff is ok, function_args',
f'args = {str(args)}, kwargs = {str(kwargs)}')
Generally, maintenance of components is the responsibility of contributors who authored them. If the original author or some other contributor does not maintain the component it may be excluded from the default build. The component will be excluded if it causes build problems, has failing tests or otherwise causes problems to the rest of the repository and the rest of contributors.
Hello, i'm trying to work out why my traces for 404s (well, all 400-level responses so far) are looking like 200s in AWS X-Ray using OpenTelemetry for an ASGI (FastAPI) application. Here's a raw trace from the X-Ray console, for a 404:
https://gist.github.com/smcoll/b28d39bc83533c38b45a9f1d78dbdf88
Some notables:
content_length
shows as 0 although the actual value in the header is 22, for a JSON responseopentelemetry-instrument --exporter otlp_span --ids-generator aws_xray uvicorn my.main:app --port 80 --host 0.0.0.0 --access-log --no-use-colors
with opentelemetry-instrumentation-fastapi 0.16b1status.status_code
as "ERROR" for the "http.response.start" span and "UNSET" for the other two. So it seems that whatever is stitching the spans together is deciding which status to apply? Where in the toolchain does that happen?Hello,
I was working on issue open-telemetry/opentelemetry-python#1108
Before I implement this, thought of clarifying some points from spec
Following from the spec:
https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/protocol/otlp.md#concurrent-requests
The maximum achievable throughput is max_concurrent_requests * >max_request_size / (network_latency +
server_response_time). For example if the request can contain at most 100 spans, network roundtrip latency is 200ms and server response time is 300 ms, then the maximum achievable throughput with one concurrent request is 100 spans / (200ms+300ms) or 200 spans per second. It is easy to see that in high latency networks or when the server response time is high to achieve good throughput the requests need to be very big or a lot concurrent requests must be done.
I had some questions regarding the spec before i start the implementation:
Resource.merge
is updated to have similar behaviour like dict.update
. Created a PR open-telemetry/opentelemetry-python#1544 to update that change.