> On Nov 7, 2017, at 8:35 AM, Zelkowitz, Evan <[email protected]>
> wrote:
>
> Proposing adding stat string support
>
> TSReturnCode TSStatGetString(int id, char *string, int len);
> TSReturnCode TSStatSetString(int id, char *string, int len);
>
> This way we can store stat strings for retrieval by TS stats. Some examples
> of things we currently have work arounds for are the interface name that TS
> is running on, its negotiated speed, load averages, other proc values, etc.
>
> I believe the stats will currently allow you to create a string stat, there
> is just no way to interface with it. I will create a plugin that uses the
> string functionality since the main reason of this is to be able to open
> source a currently proprietary plugin that uses this sort of functionality.
To do this, you'd just create the record directly.
TSMgmtStringCreate(TS_RECORDTYPE_PROCESS, "my.great.metric.name", "default
value",
TS_RECORDUPDATE_DYNAMIC, TS_RECORDCHECK_NULL, nullptr /* check_regex */,
TS_RECORDACCESS_READ_ONLY);
J