Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/opentelemetry #104

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion neverpile-eureka-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</dependency>
<dependency>
<groupId>com.neverpile.commons</groupId>
<artifactId>neverpile-commons-opentracing</artifactId>
<artifactId>neverpile-commons-opentelemetry</artifactId>
</dependency>

<!-- Spring -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.neverpile.common.opentracing.TraceInvocation;
import com.neverpile.common.opentelemetry.TraceInvocation;
import com.neverpile.eureka.api.DocumentAssociatedEntityStore;
import com.neverpile.eureka.api.DocumentService;
import com.neverpile.eureka.api.ObjectStoreService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.neverpile.common.opentracing.TraceInvocation;
import com.neverpile.common.opentelemetry.TraceInvocation;
import com.neverpile.common.util.VisibleForTesting;
import com.neverpile.eureka.api.DocumentAssociatedEntityStore;
import com.neverpile.eureka.api.MultiVersioningDocumentService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
import org.springframework.stereotype.Component;
import org.springframework.util.StreamUtils;

import com.neverpile.common.opentracing.Tag;
import com.neverpile.common.opentracing.TraceInvocation;
import com.neverpile.common.opentelemetry.Attribute;
import com.neverpile.common.opentelemetry.TraceInvocation;
import com.neverpile.eureka.tx.wal.TransactionWAL.TransactionalAction;
import com.neverpile.eureka.tx.wal.WALException;
import com.neverpile.eureka.tx.wal.WriteAheadLog;
Expand Down Expand Up @@ -224,7 +224,7 @@ public void stop() throws IOException {
*/
@Override
@TraceInvocation
public void logAction(final String id, @Tag(name = "action") final ActionType type,
public void logAction(final String id, @Attribute(name = "action") final ActionType type,
final TransactionalAction action) {
fileLock.writeLock().lock();
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
import com.hazelcast.cp.lock.FencedLock;
import com.hazelcast.map.IMap;
import com.hazelcast.multimap.MultiMap;
import com.neverpile.common.opentracing.Tag;
import com.neverpile.common.opentracing.TraceInvocation;
import com.neverpile.common.opentelemetry.Attribute;
import com.neverpile.common.opentelemetry.TraceInvocation;
import com.neverpile.eureka.tx.wal.TransactionWAL.TransactionalAction;
import com.neverpile.eureka.tx.wal.WALException;
import com.neverpile.eureka.tx.wal.WriteAheadLog;
Expand Down Expand Up @@ -183,7 +183,7 @@ private void applyActions(final ActionType type, final List<Entry> txEntries) {
*/
@Override
@TraceInvocation
public void logAction(final String id, @Tag(name="action") final ActionType type, final TransactionalAction action) {
public void logAction(final String id, @Attribute(name="action") final ActionType type, final TransactionalAction action) {
logger.debug("Logging {} action for tx {}: {}", type, id, action);
ActionEntry entry = new ActionEntry(id, type, action);
log(id, entry);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;

import com.neverpile.common.opentracing.Tag;
import com.neverpile.common.opentracing.TraceInvocation;
import com.neverpile.common.opentelemetry.Attribute;
import com.neverpile.common.opentelemetry.TraceInvocation;
import com.neverpile.eureka.ignite.IgniteConfigurationProperties;
import com.neverpile.eureka.tx.wal.TransactionWAL.TransactionalAction;
import com.neverpile.eureka.tx.wal.WALException;
Expand Down Expand Up @@ -250,7 +250,7 @@ private void applyActions(final ActionType type, final List<Entry> txEntries) {
"subsystem", "ignite.wal"
}, value = "eureka.ignite.wal.log")
@TraceInvocation
public void logAction(final String id, @Tag(name="action") final ActionType type, final TransactionalAction action) {
public void logAction(final String id, @Attribute(name="action") final ActionType type, final TransactionalAction action) {
logger.debug("Logging {} action for tx {}: {}", type, id, action);
ActionEntry entry = new ActionEntry(id, type, action);
log(id, entry);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
import com.amazonaws.services.s3.model.ObjectMetadata;
import com.amazonaws.services.s3.model.S3Object;
import com.amazonaws.services.s3.model.S3ObjectSummary;
import com.neverpile.common.opentracing.Tag;
import com.neverpile.common.opentracing.TraceInvocation;
import com.neverpile.common.opentelemetry.Attribute;
import com.neverpile.common.opentelemetry.TraceInvocation;
import com.neverpile.eureka.api.ObjectStoreService;
import com.neverpile.eureka.api.exception.VersionMismatchException;
import com.neverpile.eureka.model.ObjectName;
Expand Down Expand Up @@ -134,8 +134,8 @@ private void init() {
"subsystem", "s3.object-store"
}, value = "eureka.s3.object-store.put")
@TraceInvocation
public void put(@Tag(name = "key", valueAdapter = ObjectNameMapper.class) final ObjectName objectName,
final String version, final InputStream content, @Tag(name = "length") final long length) {
public void put(@Attribute(name = "key", valueAdapter = ObjectNameMapper.class) final ObjectName objectName,
final String version, final InputStream content, @Attribute(name = "length") final long length) {
String bucket = connectionConfiguration.getDefaultBucketName();
String key = toKey(objectName);

Expand Down Expand Up @@ -263,7 +263,7 @@ public InputStream getInputStream() {
@Override
@TraceInvocation
public Stream<StoreObject> list(
@Tag(name = "prefix", valueAdapter = ObjectNameMapper.class) final ObjectName prefix) {
@Attribute(name = "prefix", valueAdapter = ObjectNameMapper.class) final ObjectName prefix) {
String prefixKey = toKey(prefix);

ListObjectsRequest lor = new ListObjectsRequest();
Expand All @@ -280,7 +280,7 @@ public Stream<StoreObject> list(
"subsystem", "s3.object-store"
}, value = "eureka.s3.object-store.get")
@TraceInvocation
public StoreObject get(@Tag(name = "key", valueAdapter = ObjectNameMapper.class) final ObjectName objectName) {
public StoreObject get(@Attribute(name = "key", valueAdapter = ObjectNameMapper.class) final ObjectName objectName) {
try {
final S3Object object = s3client.getObject(connectionConfiguration.getDefaultBucketName(), toKey(objectName));

Expand Down Expand Up @@ -356,7 +356,7 @@ private void createBackup(final String bucket, final String key) {
}, value = "eureka.s3.object-store.check-exists")
@TraceInvocation
public boolean checkObjectExists(
@Tag(name = "key", valueAdapter = ObjectNameMapper.class) final ObjectName objectName) {
@Attribute(name = "key", valueAdapter = ObjectNameMapper.class) final ObjectName objectName) {
String bucket = connectionConfiguration.getDefaultBucketName();
String key = toKey(objectName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.neverpile.common.opentracing.TraceInvocation;
import com.neverpile.common.opentelemetry.TraceInvocation;
import com.neverpile.eureka.api.index.IndexMaintenanceService;
import com.neverpile.eureka.model.Document;

Expand Down
15 changes: 5 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<metrics-core.version>4.2.23</metrics-core.version>
<modelmapper.version>1.1.3</modelmapper.version>
<neverpile-commons.version>1.15.0</neverpile-commons.version>
<opentracing.version>0.33.0</opentracing.version>
<opentelemetry.version>1.33.0</opentelemetry.version>
<spring-boot.version>3.1.7</spring-boot.version>
<spring-security-oauth2.version>2.6.8</spring-security-oauth2.version>
<spring-boot-admin.version>3.1.7</spring-boot-admin.version>
Expand Down Expand Up @@ -114,7 +114,7 @@
</dependency>
<dependency>
<groupId>com.neverpile.commons</groupId>
<artifactId>neverpile-commons-opentracing</artifactId>
<artifactId>neverpile-commons-opentelemetry</artifactId>
<version>${neverpile-commons.version}</version>
</dependency>

Expand Down Expand Up @@ -282,14 +282,9 @@
</dependency>

<dependency>
<groupId>io.opentracing</groupId>
<artifactId>opentracing-api</artifactId>
<version>${opentracing.version}</version>
</dependency>
<dependency>
<groupId>io.opentracing</groupId>
<artifactId>opentracing-noop</artifactId>
<version>${opentracing.version}</version>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-api</artifactId>
<version>${opentelemetry.version}</version>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
Expand Down