Hi, I am @Blueswen (Yi-Wei, Liu), a Software Engineer focus on Web Application, DevOps, Cloud Native and Developer Experience.
Want to be a full stack developer, but just a stack overflow developer right now.
Trace FastAPI with Jaeger through OpenTelemetry Python API and SDK.
2023-11-17 16:31:29 * error decoding 'exporters': unknown type: "jaeger" for id: "jaeger" (valid values: [pulsar skywalking sumologic alibabacloud_logservice instana mezmo opencensus elasticsearch googlecloud prometheusremotewrite logging awsemf clickhouse dataset azuremonitor datadog dynatrace googlecloudpubsub kafka otlp otlphttp awscloudwatchlogs awsxray sapm tanzuobservability azuredataexplorer file tencentcloud_logservice zipkin sentry debug awss3 logicmonitor prometheus logzio signalfx splunk_hec coralogix f5cloud influxdb loadbalancing loki awskinesis carbon cassandra googlemanagedprometheus])
2023-11-17 16:32:30 Error: failed to get config: cannot unmarshal the configuration: 1 error(s) decoding:
@app.get("/error_test")
async def random_sleep(response: Response):
it shall be error_test
f"http://localhost:8000/"
here f
is not needed.
Don't know what's the wrong with my env? I use podman-compose
@ Mac, but it shall be the same.
forget how to fix it, I got the container name is fastapi-jaeger_app-a_1
with extra prefix fastapi-jaeger
and suffix _1
.
I have to change in all related areas to make it work as expected
main.py
like TARGET_ONE_HOST = os.environ.get("TARGET_ONE_HOST", "fastapi-jaeger_app-b_1")
// from app_b
docker-compose.yaml
for namingetc
But I think it shall not work like this, what's wrong with my env? I use podman-compose
@ Mac, but it shall be the same
Can you paste your console out in the readme, I got it like below.
$ podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
645c7459b3f8 localhost/fastapi-jaeger_app-a:latest uvicorn main:app ... 25 seconds ago Up 14 seconds 0.0.0.0:8000->8000/tcp fastapi-jaeger_app-a_1
ffd1e27990ee localhost/fastapi-jaeger_app-b:latest uvicorn main:app ... 24 seconds ago Up 13 seconds 0.0.0.0:8001->8000/tcp fastapi-jaeger_app-b_1
3334db65abff localhost/fastapi-jaeger_app-c:latest uvicorn main:app ... 23 seconds ago Up 12 seconds 0.0.0.0:8002->8000/tcp fastapi-jaeger_app-c_1
08caf128b172 localhost/fastapi-jaeger_app-d:latest uvicorn main:app ... 21 seconds ago Up 11 seconds 0.0.0.0:8003->8000/tcp fastapi-jaeger_app-d_1
b9c68f04cbfd docker.io/library/cassandra:4.1.2 cassandra -f 20 seconds ago Up 10 seconds fastapi-jaeger_cassandra_1
eea4cb843e23 docker.io/jaegertracing/jaeger-cassandra-schema:1.47.0 19 seconds ago Up 9 seconds fastapi-jaeger_cassandra-schema_1
c8592793aee5 docker.io/jaegertracing/jaeger-collector:1.47.0 --cassandra.keysp... 17 seconds ago Up Less than a second 0.0.0.0:39969->4317/tcp, 0.0.0.0:41079->4318/tcp, 0.0.0.0:39891->14250/tcp fastapi-jaeger_jaeger-collector_1
20075f5cf1a8 docker.io/otel/opentelemetry-collector-contrib:0.81.0 --config=/conf/co... 15 seconds ago Up 6 seconds 0.0.0.0:39077->4317/tcp, 0.0.0.0:44199->4318/tcp fastapi-jaeger_otel-collector_1
Fantastic repo. I want to know if there's a way to show SPM in grafana?
services:
app-a:
build: .
ports:
- "8000:8000"
volumes:
- ./src/fastapi_jaeger:/app
environment:
TARGET_ONE_HOST: "fastapi-jaeger_app-b_1"
TARGET_TWO_HOST: "fastapi-jaeger_app-c_1"
In the docker-composer.yaml
, it is better to inject above configurations (TARGET_ONE_HOST
& TARGET_TWO_HOST
related with #2 (app_b
could be good enough)
Overriding of current TracerProvider is not allowed.
Traceback (most recent call last):
File "/Users/jaydeepcheruku/git-repos/mfgot-asset-services/assets-api/app/main.py", line 173, in <module>
setting_otel(app)
File "/Users/jaydeepcheruku/git-repos/mfgot-asset-services/assets-api/app/main.py", line 164, in setting_otel
tracer.add_span_processor(BatchSpanProcessor(OTLPSpanExporterHTTP(endpoint=OTLP_DYNATRACE_ENDPOINT, headers=OTEL_EXPORTER_OTLP_HEADERS)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/jaydeepcheruku/git-repos/mfgot-asset-services/assets-api/venv/lib/python3.12/site-packages/opentelemetry/exporter/otlp/proto/http/trace_exporter/__init__.py", line 96, in __init__
self._session.headers.update(self._headers)
File "<frozen _collections_abc>", line 987, in update
ValueError: not enough values to unpack (expected 2, got 1)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.