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
We have a single Axiom dataset for our application, and typically use the environment field to separate dev, stage, and prod.
There are two problems I am facing currently:
Global attributes, I want to essentially have environment in every event logged throughout the application. I am just reading this from ENVIRONMENT env var. Since my entire application is very async via tokio, including tokio::spawn for child tasks... it's difficult to get this to "stick". I had thought about a custom layer but it seems events are immutable?
Mapping of fields, which seems to always be attributes.custom.[field]. In the case of environment, I want it to be top-level and not nested within custom attributes. How can I get it to be like this?
I have tried many things but nothing seems to work, and it's a bit confusing considering I am able to get it to work fairly easily with other axiomhq libs (like pino in JS).
Addendum
Turns out, #13 would solve the global attribute issue via with_tags(). The mapping of fields is due to Axiom's backend gRPC layer automatically nesting "non-blessed" attributes into attributes.custom, which is a bit annoying.
I spun up a simple HTTP proxy to compare why this works fine in JS land with pino. Turns out the JS library sends raw events as application/json to /datasets/:name/ingest which handles these differently than the /api/v1/traces gRPC one.
The text was updated successfully, but these errors were encountered:
We have a single Axiom dataset for our application, and typically use the
environment
field to separatedev
,stage
, andprod
.There are two problems I am facing currently:
Global attributes, I want to essentially have
environment
in every event logged throughout the application. I am just reading this fromENVIRONMENT
env var. Since my entire application is very async viatokio
, includingtokio::spawn
for child tasks... it's difficult to get this to "stick". I had thought about a custom layer but it seems events are immutable?Mapping of fields, which seems to always be
attributes.custom.[field]
. In the case ofenvironment
, I want it to be top-level and not nested within custom attributes. How can I get it to be like this?I have tried many things but nothing seems to work, and it's a bit confusing considering I am able to get it to work fairly easily with other axiomhq libs (like
pino
in JS).Addendum
Turns out, #13 would solve the global attribute issue via
with_tags()
. The mapping of fields is due to Axiom's backend gRPC layer automatically nesting "non-blessed" attributes intoattributes.custom
, which is a bit annoying.I spun up a simple HTTP proxy to compare why this works fine in JS land with pino. Turns out the JS library sends raw events as
application/json
to/datasets/:name/ingest
which handles these differently than the/api/v1/traces
gRPC one.The text was updated successfully, but these errors were encountered: