Skip to content
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

Unnecessary Redacted due to 'auth' #248

Closed
mattzcarey opened this issue Jun 6, 2024 · 6 comments
Closed

Unnecessary Redacted due to 'auth' #248

mattzcarey opened this issue Jun 6, 2024 · 6 comments
Assignees
Labels
Bug Bug related to the Logfire Python SDK

Comments

@mattzcarey
Copy link

Description

I have a FastAPI endpoint which I am hitting to get some authentication types from some documentation. The endpoint is /auth/classify. Neither the input or the output from that endpoint contains secrets yet the body is still redacted:

input": {
  "auth_types" :[
    "[Redacted due to 'auth']"
  ]
}

Is there anyway to switch this off as it would be nice to see these in the logs. To be clear this isnt a header or anything. This is just a body with the key auth and a value of string[] (it's actually an enum of values like 'BASIC', 'BEARER' etc.)

I guess I can manually emit a span but that kinda defeats the point of auto instrumentation.

Python, Logfire & OS Versions, related packages (not required)

logfire="0.40.0"
platform="macOS-14.5-arm64-arm-64bit"
python="3.11.6 (main, May  8 2024, 18:55:10) [Clang 15.0.0 (clang-1500.3.9.4)]"
[related_packages]
requests="2.32.3"
pydantic="2.7.2"
fastapi="0.111.0"
openai="1.30.5"
protobuf="4.25.3"
rich="13.7.1"
executing="2.0.1"
opentelemetry-api="1.25.0"
opentelemetry-exporter-otlp-proto-common="1.25.0"
opentelemetry-exporter-otlp-proto-http="1.25.0"
opentelemetry-instrumentation="0.46b0"
opentelemetry-instrumentation-aiohttp-client="0.46b0"
opentelemetry-instrumentation-asgi="0.46b0"
opentelemetry-instrumentation-dbapi="0.46b0"
opentelemetry-instrumentation-fastapi="0.46b0"
opentelemetry-instrumentation-httpx="0.46b0"
opentelemetry-instrumentation-jinja2="0.46b0"
opentelemetry-instrumentation-requests="0.46b0"
opentelemetry-instrumentation-sqlite3="0.46b0"
opentelemetry-instrumentation-urllib="0.46b0"
opentelemetry-instrumentation-urllib3="0.46b0"
opentelemetry-proto="1.25.0"
opentelemetry-sdk="1.25.0"
opentelemetry-semantic-conventions="0.46b0"
opentelemetry-util-http="0.46b0"
@mattzcarey mattzcarey added the Bug Bug related to the Logfire Python SDK label Jun 6, 2024
@alexmojaki
Copy link
Contributor

See https://docs.pydantic.dev/logfire/guides/advanced/scrubbing/#scrubbing-less-with-a-callback for how to whitelist values.

You can find this page if you search the docs for 'redacted' but I think you're at least the 4th person to ask about this so I think people just aren't trying that. We should probably change [Redacted due to 'auth'] to [Scrubbed due to 'auth'] to increase the chances that people will see the page in the sidebar or the params to configure and make the connection. Do you think that would have helped you?

@dmontagu I think we need to implement https://pydanticlogfire.slack.com/archives/C06EDRBSAH3/p1714500893342199?thread_ts=1714500208.780959&cid=C06EDRBSAH3:

The UI could help, e.g. you could click on a redacted value and get a popup with some generated callback code and a link to docs.

WDYT of that? It'd require some changes to both the SDK and UI and some design discussion.

@mattzcarey
Copy link
Author

Thanks. Makes alot of sense I didnt quite get there in the docs yet :)

@alexmojaki
Copy link
Contributor

Reopening because we still need to do something here, too many users stumble on it.

@Kludex
Copy link
Member

Kludex commented Jul 8, 2024

Reopening because we still need to do something here, too many users stumble on it.

What do we need to do here?

@alexmojaki
Copy link
Contributor

The SDK changes have been recently released, now @dmontagu or another frontend dev needs to display the generated code and a link to docs somewhere visible in the details panel.

@alexmojaki
Copy link
Contributor

Done, thanks @dmontagu!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug related to the Logfire Python SDK
Projects
None yet
Development

No branches or pull requests

4 participants