Skip to content

Commit 3b46ef9

Browse files
committed
./gradlew spotlessApply
1 parent 4d9a69d commit 3b46ef9

File tree

5 files changed

+56
-222
lines changed

5 files changed

+56
-222
lines changed

ibm-mq-metrics/docs/metrics.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -815,5 +815,3 @@
815815
|---|---|---|---|---|---|
816816
| `error.code` | string | The reason code associated with an error | `2038`; `2543`; `2009` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) |
817817
| `ibm.mq.queue.manager` | string | The name of the IBM queue manager | `MQ1` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) |
818-
819-

ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/WmqMonitor.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,18 @@
55

66
package io.opentelemetry.ibm.mq;
77

8-
import static io.opentelemetry.ibm.mq.metrics.IbmMqAttributes.IBM_MQ_QUEUE_MANAGER;
98
import static io.opentelemetry.ibm.mq.metrics.IbmMqAttributes.ERROR_CODE;
9+
import static io.opentelemetry.ibm.mq.metrics.IbmMqAttributes.IBM_MQ_QUEUE_MANAGER;
1010

1111
import com.fasterxml.jackson.databind.ObjectMapper;
1212
import com.ibm.mq.MQException;
1313
import com.ibm.mq.MQQueueManager;
1414
import com.ibm.mq.headers.pcf.PCFMessageAgent;
15-
import io.opentelemetry.api.common.AttributeKey;
1615
import io.opentelemetry.api.common.Attributes;
1716
import io.opentelemetry.api.metrics.LongCounter;
1817
import io.opentelemetry.api.metrics.LongGauge;
1918
import io.opentelemetry.api.metrics.Meter;
2019
import io.opentelemetry.ibm.mq.config.QueueManager;
21-
import io.opentelemetry.ibm.mq.metrics.IbmMqAttributes;
2220
import io.opentelemetry.ibm.mq.metrics.Metrics;
2321
import io.opentelemetry.ibm.mq.metrics.MetricsConfig;
2422
import io.opentelemetry.ibm.mq.metricscollector.ChannelMetricsCollector;
@@ -117,7 +115,8 @@ public void run(QueueManager queueManager) {
117115
if (e.getCause() instanceof MQException) {
118116
MQException mqe = (MQException) e.getCause();
119117
String errorCode = String.valueOf(mqe.getReason());
120-
errorCodesCounter.add(1, Attributes.of(IBM_MQ_QUEUE_MANAGER, queueManagerName, ERROR_CODE, errorCode));
118+
errorCodesCounter.add(
119+
1, Attributes.of(IBM_MQ_QUEUE_MANAGER, queueManagerName, ERROR_CODE, errorCode));
121120
}
122121
} finally {
123122
if (this.metricsConfig.isIbmMqHeartbeatEnabled()) {

ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/metrics/IbmMqAttributes.java

Lines changed: 40 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -2,82 +2,53 @@
22
* Copyright The OpenTelemetry Authors
33
* SPDX-License-Identifier: Apache-2.0
44
*/
5+
56
package io.opentelemetry.ibm.mq.metrics;
67

7-
import static io.opentelemetry.api.common.AttributeKey.stringKey;
88
import static io.opentelemetry.api.common.AttributeKey.longKey;
9+
import static io.opentelemetry.api.common.AttributeKey.stringKey;
10+
911
import io.opentelemetry.api.common.AttributeKey;
1012

1113
// This file is generated using weaver. Do not edit manually.
1214

1315
/** Attribute definitions generated from a Weaver model. Do not edit manually. */
1416
public final class IbmMqAttributes {
1517

16-
/**
17-
The name of the IBM queue manager
18-
*/
19-
public final static AttributeKey<String> IBM_MQ_QUEUE_MANAGER = stringKey("ibm.mq.queue.manager");
20-
21-
22-
/**
23-
The system-specific name of the messaging operation.
24-
*/
25-
public final static AttributeKey<String> MESSAGING_DESTINATION_NAME = stringKey("messaging.destination.name");
26-
27-
28-
/**
29-
The name of the channel
30-
*/
31-
public final static AttributeKey<String> IBM_MQ_CHANNEL_NAME = stringKey("ibm.mq.channel.name");
32-
33-
34-
/**
35-
The type of the channel
36-
*/
37-
public final static AttributeKey<String> IBM_MQ_CHANNEL_TYPE = stringKey("ibm.mq.channel.type");
38-
39-
40-
/**
41-
The job name
42-
*/
43-
public final static AttributeKey<String> IBM_MQ_JOB_NAME = stringKey("ibm.mq.job.name");
44-
45-
46-
/**
47-
The start time of the channel as seconds since Epoch.
48-
*/
49-
public final static AttributeKey<Long> IBM_MQ_CHANNEL_START_TIME = longKey("ibm.mq.channel.start.time");
50-
51-
52-
/**
53-
The queue type
54-
*/
55-
public final static AttributeKey<String> IBM_MQ_QUEUE_TYPE = stringKey("ibm.mq.queue.type");
56-
57-
58-
/**
59-
The listener name
60-
*/
61-
public final static AttributeKey<String> IBM_MQ_LISTENER_NAME = stringKey("ibm.mq.listener.name");
62-
63-
64-
/**
65-
Short name or login/username of the user.
66-
*/
67-
public final static AttributeKey<String> USER_NAME = stringKey("user.name");
68-
69-
70-
/**
71-
Logical name of the service.
72-
*/
73-
public final static AttributeKey<String> SERVICE_NAME = stringKey("service.name");
74-
75-
76-
/**
77-
The reason code associated with an error
78-
*/
79-
public final static AttributeKey<String> ERROR_CODE = stringKey("error.code");
80-
81-
82-
private IbmMqAttributes(){}
83-
}
18+
/** The name of the IBM queue manager */
19+
public static final AttributeKey<String> IBM_MQ_QUEUE_MANAGER = stringKey("ibm.mq.queue.manager");
20+
21+
/** The system-specific name of the messaging operation. */
22+
public static final AttributeKey<String> MESSAGING_DESTINATION_NAME =
23+
stringKey("messaging.destination.name");
24+
25+
/** The name of the channel */
26+
public static final AttributeKey<String> IBM_MQ_CHANNEL_NAME = stringKey("ibm.mq.channel.name");
27+
28+
/** The type of the channel */
29+
public static final AttributeKey<String> IBM_MQ_CHANNEL_TYPE = stringKey("ibm.mq.channel.type");
30+
31+
/** The job name */
32+
public static final AttributeKey<String> IBM_MQ_JOB_NAME = stringKey("ibm.mq.job.name");
33+
34+
/** The start time of the channel as seconds since Epoch. */
35+
public static final AttributeKey<Long> IBM_MQ_CHANNEL_START_TIME =
36+
longKey("ibm.mq.channel.start.time");
37+
38+
/** The queue type */
39+
public static final AttributeKey<String> IBM_MQ_QUEUE_TYPE = stringKey("ibm.mq.queue.type");
40+
41+
/** The listener name */
42+
public static final AttributeKey<String> IBM_MQ_LISTENER_NAME = stringKey("ibm.mq.listener.name");
43+
44+
/** Short name or login/username of the user. */
45+
public static final AttributeKey<String> USER_NAME = stringKey("user.name");
46+
47+
/** Logical name of the service. */
48+
public static final AttributeKey<String> SERVICE_NAME = stringKey("service.name");
49+
50+
/** The reason code associated with an error */
51+
public static final AttributeKey<String> ERROR_CODE = stringKey("error.code");
52+
53+
private IbmMqAttributes() {}
54+
}

0 commit comments

Comments
 (0)