-
Notifications
You must be signed in to change notification settings - Fork 872
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add code attributes to quartz spans (#4332)
* Add code attributes to quartz spans * Use constants!
- Loading branch information
Showing
3 changed files
with
54 additions
and
3 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
...main/java/io/opentelemetry/instrumentation/quartz/v2_0/QuartzCodeAttributesExtractor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.instrumentation.quartz.v2_0; | ||
|
||
import io.opentelemetry.instrumentation.api.instrumenter.code.CodeAttributesExtractor; | ||
import org.checkerframework.checker.nullness.qual.Nullable; | ||
import org.quartz.JobExecutionContext; | ||
|
||
public class QuartzCodeAttributesExtractor | ||
extends CodeAttributesExtractor<JobExecutionContext, Void> { | ||
@Override | ||
protected Class<?> codeClass(JobExecutionContext jobExecutionContext) { | ||
return jobExecutionContext.getJobDetail().getJobClass(); | ||
} | ||
|
||
@Override | ||
protected String methodName(JobExecutionContext jobExecutionContext) { | ||
return "execute"; | ||
} | ||
|
||
@Override | ||
@Nullable | ||
protected String filePath(JobExecutionContext jobExecutionContext) { | ||
return null; | ||
} | ||
|
||
@Override | ||
@Nullable | ||
protected Long lineNumber(JobExecutionContext jobExecutionContext) { | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters