Class ElasticsearchLogStorageRetriever
java.lang.Object
io.jenkins.plugins.opentelemetry.backend.elastic.ElasticsearchLogStorageRetriever
- All Implemented Interfaces:
LogStorageRetriever,Closeable,AutoCloseable
public class ElasticsearchLogStorageRetriever
extends Object
implements LogStorageRetriever, Closeable
Retrieve the logs from Elasticsearch.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionElasticsearchLogStorageRetriever(String elasticsearchUrl, boolean disableSslVerifications, String elasticsearchCredentialsId, groovy.text.Template buildLogsVisualizationUrlTemplate, TemplateBindingsProvider templateBindingsProvider) -
Method Summary
Modifier and TypeMethodDescriptionExample of a successful check:voidclose()overallLog(String jobFullName, int runNumber, String traceId, String spanId, boolean complete, Instant startTime, Instant endTime) protected static StringprettyPrintPhaseRetentionPolicy(co.elastic.clients.elasticsearch.ilm.Phase phase, String phaseName) stepLog(String jobFullName, int runNumber, String flowNodeId, String traceId, String spanId, boolean complete, Instant startTime, Instant endTime) toString()
-
Field Details
-
KEEPALIVE_INTERVAL_DEFAULT
- See Also:
-
KEEPALIVE_DEFAULT
- See Also:
-
KEEPALIVE_INTERVAL_PROPERTY
-
KEEPALIVE_PROPERTY
-
KEEPALIVE_INTERVAL
public static final int KEEPALIVE_INTERVAL -
KEEPALIVE
public static final boolean KEEPALIVE
-
-
Constructor Details
-
ElasticsearchLogStorageRetriever
@MustBeClosed public ElasticsearchLogStorageRetriever(@NonNull String elasticsearchUrl, boolean disableSslVerifications, @NonNull String elasticsearchCredentialsId, @NonNull groovy.text.Template buildLogsVisualizationUrlTemplate, @NonNull TemplateBindingsProvider templateBindingsProvider)
-
-
Method Details
-
overallLog
@NonNull public LogsQueryResult overallLog(@NonNull String jobFullName, int runNumber, @NonNull String traceId, @NonNull String spanId, boolean complete, @NonNull Instant startTime, Instant endTime) - Specified by:
overallLogin interfaceLogStorageRetriever- Parameters:
jobFullName- seeAbstractItem.getFullName()runNumber- seeRun.getNumber()complete- if true, we claim to be serving the complete log for a build, so implementations should be sure to retrieve final log linesstartTime- Pipeline run start time. SeeRun.getStartTimeInMillis()endTime-nullif the pipeline is still running. SeeRun.getDuration()
-
stepLog
@NonNull public LogsQueryResult stepLog(@NonNull String jobFullName, int runNumber, @NonNull String flowNodeId, @NonNull String traceId, @NonNull String spanId, boolean complete, @NonNull Instant startTime, @Nullable Instant endTime) - Specified by:
stepLogin interfaceLogStorageRetriever- Parameters:
jobFullName- seeAbstractItem.getFullName()runNumber- seeRun.getNumber()flowNodeId- seeFlowNode.getId()complete- if true, we claim to be serving the complete log for a build, so implementations should be sure to retrieve final log linesstartTime- Pipeline run start time. SeeRun.getStartTimeInMillis()endTime-nullif the pipeline is still running. SeeRun.getDuration()
-
checkElasticsearchSetup
Example of a successful check:OK: Connected to Elasticsearch https://***.es.example.com with user 'jenkins'. OK: Indices 'logs-*' found. -
prettyPrintPhaseRetentionPolicy
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
toString
-