[#BloombergLP-balm-ConfigurationUtil-setUserData-04]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balm.adoc[balm]::xref:BloombergLP/balm/ConfigurationUtil.adoc[ConfigurationUtil]::setUserData
:relfileprefix: ../../../
:mrdocs:

Associate `value` with `key` on metrics matching `categoryName`&period;

== Synopsis

Declared in `&lt;balm&lowbar;configurationutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
void
setUserData(
    char const* categoryName,
    xref:BloombergLP/balm/MetricDescription/UserDataKey.adoc[MetricDescription::UserDataKey] key,
    void const* value,
    xref:BloombergLP/balm/MetricsManager.adoc[MetricsManager]* manager = 0);
----

== Description

Associate the specified `value` with the specified data `key` in any metric belonging to a category having the specified `categoryName`, or, if `categoryName` ends with an asterisk (`&ast;`), any metric belonging to a category whose name begins with `categoryName` (without the asterisk)&period; Optionally specify a metrics `manager` to configure&period; If `manager` is 0, configure the default metrics manager&semi; if `manager` is 0 and the default metrics manager has not been initialized, this method has no effect&period; This association applies to existing metrics as well as any subsequently created ones&period; When a metric is created that matches more than one registered category prefix, it is not specified which supplied value will be associated with `key`, unless only one of those values is non&hyphen;null, in which case the unique non&hyphen;null value is used&period; The behavior is undefined unless `key` was previously created for the indicated metrics manager&apos;s metrics registry (e&period;g&period;, by calling `createUserDataKey`)&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *categoryName*
| category name, or prefix ending in `&ast;`
| *key*
| user&hyphen;data key previously obtained from `createUserDataKey`
| *value*
| opaque user&hyphen;data value to associate
| *manager*
| metrics manager to configure&semi; 0 uses the default
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
