-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
instrument API with open telemetry/uptrace
- Loading branch information
1 parent
9ac550b
commit 32aca6b
Showing
10 changed files
with
111 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import uptrace | ||
from opentelemetry.instrumentation.fastapi import FastAPIInstrumentor | ||
from lib.secrets import Secrets | ||
|
||
|
||
def post_fork(server, worker): # pylint: disable=unused-argument | ||
uptrace.configure_opentelemetry( | ||
dsn=Secrets.get_secret("UPTRACE_DSN"), | ||
service_name="infinity-api", | ||
service_version="1.2.0", | ||
deployment_environment="production", | ||
) | ||
from app.lib import ( # pylint: disable=import-outside-toplevel | ||
server as fastapi_server, | ||
) | ||
|
||
FastAPIInstrumentor.instrument_app(fastapi_server) |
Oops, something went wrong.