---
title: "Attributes"
description: "Learn how to construct custom attributes to enrich logs."
url: https://docs.sentry.io/platforms/native/guides/qt/enriching-events/attributes/
---

# Attributes | Sentry for Qt

Attributes are a specific kind of `sentry_value_t` object which contains items with a `value`, `type` and optional `unit` field. The type is inferred from the given `sentry_value_t` value, which can be `bool`, `int32`, `int64`, `uint64`, `double` or `string`.

```c
sentry_value_t attributes = sentry_value_new_object();
sentry_value_t attr = sentry_value_new_attribute(sentry_value_new_string("my_attribute"), NULL);
sentry_value_t attr_2 = sentry_value_new_attribute(sentry_value_new_int64(INT64_MAX), "fermions");
sentry_value_t attr_3 = sentry_value_new_attribute(sentry_value_new_int64(INT64_MIN), "bosons");
sentry_value_set_by_key(attributes, "my.custom.attribute", attr);
sentry_value_set_by_key(attributes, "number.first", attr_2);
sentry_value_set_by_key(attributes, "number.second", attr_3);
```

Attributes can currently be used to enrich the following:

* [Structured logs](https://docs.sentry.io/platforms/native/logs.md#additional-attributes)
