{"source":"semconv","version":"1.45.0","attribute":{"id":"kafka.message.key","type":"string","stability":"development","brief":"Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message.id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set.","note":"If the key type is not string, its string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don't include its value.","examples":["myKey"],"namespace":"kafka","definedIn":"model/kafka/registry.yaml","usedBy":[{"groupId":"messaging.kafka.attributes.common","groupType":"attribute_group","requirementLevel":"recommended"},{"groupId":"span.messaging.kafka.create.producer","groupType":"span","signalName":"messaging.create.producer","requirementLevel":"recommended"},{"groupId":"span.messaging.kafka.process.consumer","groupType":"span","signalName":"messaging.process.consumer","requirementLevel":"recommended"},{"groupId":"span.messaging.kafka.receive.client","groupType":"span","signalName":"messaging.receive.client","requirementLevel":"recommended"},{"groupId":"span.messaging.kafka.send.client","groupType":"span","signalName":"messaging.send.client","requirementLevel":"recommended"},{"groupId":"span.messaging.kafka.send.producer","groupType":"span","signalName":"messaging.send.producer","requirementLevel":"recommended"}]},"history":[{"version":"1.45.0","publishedAt":"2026-11-02T16:11:42Z","kind":"first-seen","detail":"Added as development.","severity":"informational"}],"replaces":["messaging.kafka.message.key"]}