[#BloombergLP-balm-MetricsManager-addSpecificPublisher-0e]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balm.adoc[balm]::xref:BloombergLP/balm/MetricsManager.adoc[MetricsManager]::addSpecificPublisher
:relfileprefix: ../../../
:mrdocs:

Add the specified `publisher` to the set of publishers that will be used to publish metrics for the category identified by the specified `categoryName`&period; Return 0 on success, and a non&hyphen;zero value with no effect if `publisher` has already been registered to publish the identified category&period; The behavior is undefined unless `categoryName` is null&hyphen;terminated&period; Note that this method will fail and return a non&hyphen;zero value if `publisher` has previously been registered to publish _every_ category (using the alternative `addGeneralPublisher` method)&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
addSpecificPublisher(
    char const* categoryName,
    xref:bsl/shared_ptr-0a.adoc[bsl::shared&lowbar;ptr&lt;Publisher&gt;] const& publisher);
----


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