mirror of
https://github.com/netdata/netdata.git
synced 2025-04-30 07:30:04 +00:00
Use only stock configuration filenames as module names (#11400)
This commit is contained in:
parent
a373a3dbb6
commit
ab85abbdb3
1 changed files with 11 additions and 6 deletions
|
@ -196,13 +196,13 @@ typedef struct statsd_app_chart_dimension {
|
||||||
} STATSD_APP_CHART_DIM;
|
} STATSD_APP_CHART_DIM;
|
||||||
|
|
||||||
typedef struct statsd_app_chart {
|
typedef struct statsd_app_chart {
|
||||||
const char *source;
|
|
||||||
const char *id;
|
const char *id;
|
||||||
const char *name;
|
const char *name;
|
||||||
const char *title;
|
const char *title;
|
||||||
const char *family;
|
const char *family;
|
||||||
const char *context;
|
const char *context;
|
||||||
const char *units;
|
const char *units;
|
||||||
|
const char *module;
|
||||||
long priority;
|
long priority;
|
||||||
RRDSET_TYPE chart_type;
|
RRDSET_TYPE chart_type;
|
||||||
STATSD_APP_CHART_DIM *dimensions;
|
STATSD_APP_CHART_DIM *dimensions;
|
||||||
|
@ -1214,10 +1214,15 @@ static int statsd_readfile(const char *filename, STATSD_APP *app, STATSD_APP_CHA
|
||||||
chart->next = app->charts;
|
chart->next = app->charts;
|
||||||
app->charts = chart;
|
app->charts = chart;
|
||||||
|
|
||||||
{
|
if (!strncmp(
|
||||||
char lineandfile[FILENAME_MAX + 1];
|
filename,
|
||||||
snprintfz(lineandfile, FILENAME_MAX, "%zu@%s", line, filename);
|
netdata_configured_stock_config_dir,
|
||||||
chart->source = strdupz(lineandfile);
|
strlen(netdata_configured_stock_config_dir))) {
|
||||||
|
char tmpfilename[FILENAME_MAX + 1];
|
||||||
|
strcpy(tmpfilename, filename);
|
||||||
|
chart->module = strdupz(basename(tmpfilename));
|
||||||
|
} else {
|
||||||
|
chart->module = strdupz("synthetic_chart");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1996,7 +2001,7 @@ static inline void statsd_update_app_chart(STATSD_APP *app, STATSD_APP_CHART *ch
|
||||||
, chart->title // title
|
, chart->title // title
|
||||||
, chart->units // units
|
, chart->units // units
|
||||||
, PLUGIN_STATSD_NAME // plugin
|
, PLUGIN_STATSD_NAME // plugin
|
||||||
, chart->source // module
|
, chart->module // module
|
||||||
, chart->priority // priority
|
, chart->priority // priority
|
||||||
, statsd.update_every // update every
|
, statsd.update_every // update every
|
||||||
, chart->chart_type // chart type
|
, chart->chart_type // chart type
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue