chitin-openclaw-plugin 0.3.3 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +10 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -157,8 +157,16 @@ var plugin = {
|
|
|
157
157
|
if (k) headerObj[k.trim()] = v.join("=").trim();
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
+
const agentName = process.env.AGENT_NAME || "unknown";
|
|
161
|
+
const agentId = process.env.AGENT_ID || "unknown";
|
|
162
|
+
const pluginResource = resourceFromAttributes({
|
|
163
|
+
[ATTR_SERVICE_NAME]: "chitin-plugin",
|
|
164
|
+
"service.instance.id": `${agentName}-${agentId.slice(0, 8)}`,
|
|
165
|
+
"agent.name": agentName,
|
|
166
|
+
"agent.id": agentId
|
|
167
|
+
});
|
|
160
168
|
const provider = new NodeTracerProvider({
|
|
161
|
-
resource:
|
|
169
|
+
resource: pluginResource,
|
|
162
170
|
spanProcessors: [
|
|
163
171
|
new BatchSpanProcessor(new OTLPTraceExporter({
|
|
164
172
|
url: `${endpoint}/v1/traces`,
|
|
@@ -170,7 +178,7 @@ var plugin = {
|
|
|
170
178
|
new HttpInstrumentation().enable();
|
|
171
179
|
new UndiciInstrumentation().enable();
|
|
172
180
|
const logProvider = new LoggerProvider({
|
|
173
|
-
resource:
|
|
181
|
+
resource: pluginResource,
|
|
174
182
|
processors: [
|
|
175
183
|
new BatchLogRecordProcessor(
|
|
176
184
|
new OTLPLogExporter({ url: `${endpoint}/v1/logs`, headers: headerObj })
|