if BUILD_PLUGIN_OPEN_TELEMETRY
pkglib_LTLIBRARIES += open_telemetry.la
open_telemetry_la_SOURCES = \
- src/open_telemetry.cc \
+ src/open_telemetry.cc src/open_telemetry.h \
src/open_telemetry_exporter.cc \
src/open_telemetry_receiver.cc \
opentelemetry/proto/collector/metrics/v1/metrics_service.grpc.pb.cc \
--- /dev/null
+/**
+ * collectd - src/open_telemetry.h
+ * Copyright (C) 2024 Florian octo Forster
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Florian octo Forster <octo at collectd.org>
+ **/
+
+#ifndef OPEN_TELEMETRY_H
+#define OPEN_TELEMETRY_H 1
+
+extern "C" {
+#include "daemon/collectd.h"
+#include "daemon/configfile.h"
+}
+
+#include <grpc++/grpc++.h>
+
+int exporter_config(oconfig_item_t *ci);
+int receiver_config(oconfig_item_t *ci);
+
+int config_get_file(oconfig_item_t const *ci, grpc::string *out);
+
+#endif
#include "opentelemetry/proto/metrics/v1/metrics.pb.h"
#include "opentelemetry/proto/resource/v1/resource.pb.h"
+#include "open_telemetry.h"
+
#ifndef OT_DEFAULT_PORT
#define OT_DEFAULT_PORT "4317"
#endif
done = true;
}
-// config_get_file is implemented in src/open_telemetry_exporter.cc
-int config_get_file(oconfig_item_t const *ci, grpc::string *out);
-
/*
* collectd plugin interface
*/