-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add docs about map fields #65
base: main
Are you sure you want to change the base?
Conversation
@c-ehrlich This looks great! Thank you so much for writing up the base. |
|
||
If you are ingesting tracing data using the [OTLP/HTTP endpoint for traces and logs](/send-data/opentelemetry), you may have noticed that some attributes are moved into the `attributes.custom` map field. | ||
The benefit of map fields is that you can store additional attributes without adding more fields. This is particularly useful when the shape of your data is unpredictable (for example, additional attributes added by an OpenTelemetry instrumentation). Using map fields means that you can avoid reaching the field limit of a dataset and improve query performance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"by OpenTelemetry instrumentation" sounds more natural i think
|
||
```kusto | ||
['otel-demo-traces'] | ||
| where ['attributes.http.url'] == 'http://opentelemetry-demo-frontendproxy:8080/api/cart' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a string field, not a map (given it's being compared against a string value)
|
||
[Run in playground](https://play.axiom.co/axiom-play-qf1k/explorer?initForm=%7b%22apl%22%3a%22%5b%27otel-demo-traces%27%5d%5cn%7c%20where%20%5b%27attributes.http.url%27%5d%20%3d%3d%20%27http%3a%2f%2fopentelemetry-demo-frontendproxy%3a8080%2fapi%2fcart%27%22%2c%22queryOptions%22%3a%7b%22quickRange%22%3a%2230d%22%7d%7d) | ||
|
||
To access `http.protocol` inside the `attributes.custom` map field, use the syntax `['MAP_FIELD_NAME']['INDEX_TO_MAP_FIELD']` instead: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the bracketing only needs to happen when there's dots (or other special chars) in the name
if the field is called for example attrs
and the property foo
, attrs.foo
is perfectly valid (but of course ['attrs']['foo']
also works, and so would attrs['foo']
or ['attrs'].foo
)
|
||
Map fields are a special type of field that can hold a collection of nested key-value pairs within a single field. You can think of the content of a map field as a JSON object. | ||
|
||
## Benefits of map fields |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should also mention drawbacks - querying them uses more query gbms, there's no visibility into them from the schema (ie autocomplete will not know what properties are inside the map)
Preview: https://axiom-map-fields-docs.mintlify.app/apl/data-types/map-fields