From 14b7c953adf54257e35b83175064ec7231c278d5 Mon Sep 17 00:00:00 2001 From: Mikhail Petrov Date: Tue, 21 Jul 2026 12:16:48 +0300 Subject: [PATCH 1/2] IGNITE-28910 Ignite Tracing public API was deprecated and internal implementation was removed --- checkstyle/checkstyle-suppressions.xml | 3 - docs/_data/toc.yaml | 2 - docs/_docs/code-snippets/java/pom.xml | 5 - .../org/apache/ignite/snippets/Tracing.java | 110 -- docs/_docs/code-snippets/xml/tracing.xml | 45 - docs/_docs/key-value-api/transactions.adoc | 2 - docs/_docs/monitoring-metrics/tracing.adoc | 240 ---- docs/_docs/tools/control-script.adoc | 66 - .../jmh/misc/JmhTracingContextBenchmark.java | 108 -- .../org/apache/ignite/spi/tracing/Scope.java | 4 + .../CommandHandlerParsingTest.java | 184 --- .../IgniteControlUtilityTestSuite2.java | 3 - .../GridCommandHandlerClusterByClassTest.java | 1 - ...ommandHandlerTracingConfigurationTest.java | 394 ------ .../main/java/org/apache/ignite/Ignite.java | 3 + .../org/apache/ignite/IgniteTransactions.java | 5 +- .../configuration/IgniteConfiguration.java | 18 +- .../apache/ignite/events/DiscoveryEvent.java | 22 - .../ignite/internal/GridKernalContext.java | 8 - .../internal/GridKernalContextImpl.java | 14 - .../ignite/internal/IgniteComponentType.java | 7 - .../apache/ignite/internal/IgniteKernal.java | 19 +- .../apache/ignite/internal/IgnitionEx.java | 4 - .../management/IgniteCommandRegistry.java | 2 - .../AbstractTracingConfigurationCommand.java | 49 - .../tracing/TracingConfigurationCommand.java | 90 -- .../TracingConfigurationGetAllCommand.java | 31 - .../TracingConfigurationGetAllCommandArg.java | 61 - .../TracingConfigurationGetCommand.java | 31 - .../TracingConfigurationGetCommandArg.java | 76 -- .../tracing/TracingConfigurationItem.java | 150 --- .../TracingConfigurationResetAllCommand.java | 37 - .../TracingConfigurationResetCommand.java | 36 - .../TracingConfigurationSetCommand.java | 34 - .../TracingConfigurationSetCommandArg.java | 66 - .../tracing/TracingConfigurationTask.java | 214 ---- .../TracingConfigurationTaskResult.java | 91 -- .../managers/communication/GridIoManager.java | 112 +- .../managers/communication/GridIoMessage.java | 19 +- .../managers/communication/TraceRunnable.java | 63 - .../discovery/GridDiscoveryManager.java | 33 +- .../managers/tracing/GridTracingManager.java | 541 -------- .../bulkload/BulkLoadProcessor.java | 36 +- .../cache/CacheAffinitySharedManager.java | 7 - .../GridCachePartitionExchangeManager.java | 24 - .../processors/cache/GridCacheProcessor.java | 2 +- .../distributed/dht/GridDhtLockFuture.java | 68 +- .../dht/GridDhtTxFinishFuture.java | 104 +- .../dht/GridDhtTxPrepareFuture.java | 220 ++-- .../colocated/GridDhtColocatedLockFuture.java | 136 +-- .../GridDhtPartitionsExchangeFuture.java | 47 - .../topology/PartitionReservationManager.java | 71 +- ...OptimisticSerializableTxPrepareFuture.java | 44 +- .../GridNearOptimisticTxPrepareFuture.java | 125 +- ...dNearOptimisticTxPrepareFutureAdapter.java | 55 +- .../GridNearPessimisticTxPrepareFuture.java | 70 +- .../near/GridNearTxFinishFuture.java | 133 +- .../distributed/near/GridNearTxLocal.java | 799 ++++++------ .../reader/StandaloneGridKernalContext.java | 7 - .../transactions/IgniteTransactionsImpl.java | 28 +- .../cache/transactions/IgniteTxHandler.java | 504 ++++---- .../transactions/TransactionProxyImpl.java | 200 ++- .../query/running/GridRunningQueryInfo.java | 13 - .../query/running/RunningQueryManager.java | 159 ++- .../processors/tracing/DeferredSpan.java | 91 -- .../processors/tracing/NoopTracing.java | 49 - .../internal/processors/tracing/SpanImpl.java | 104 -- .../processors/tracing/TraceableIterator.java | 66 - .../internal/processors/tracing/Tracing.java | 45 - .../DistributedTracingConfiguration.java | 56 - .../GridTracingConfigurationManager.java | 222 ---- .../NoopTracingConfigurationManager.java | 6 +- .../tracing/messages/SpanContainer.java | 82 -- .../tracing/messages/TraceableMessage.java | 28 - .../messages/TraceableMessagesHandler.java | 106 -- .../messages/TraceableMessagesTable.java | 88 -- .../internal/tracing/TracingSpiType.java | 48 - .../tcp/TcpCommunicationSpi.java | 4 - .../tcp/internal/GridNioServerWrapper.java | 14 - .../internal/InboundConnectionHandler.java | 9 - .../TcpCommunicationConfigInitializer.java | 7 - .../spi/discovery/DiscoveryNotification.java | 16 +- .../isolated/IsolatedDiscoverySpi.java | 6 +- .../ignite/spi/discovery/tcp/ClientImpl.java | 104 +- .../ignite/spi/discovery/tcp/ServerImpl.java | 237 +--- .../spi/discovery/tcp/TcpDiscoveryImpl.java | 10 - .../TcpDiscoveryAbstractTraceableMessage.java | 95 -- .../TcpDiscoveryCustomEventMessage.java | 2 +- .../TcpDiscoveryJoinRequestMessage.java | 2 +- .../TcpDiscoveryNodeAddFinishedMessage.java | 3 +- .../TcpDiscoveryNodeAddedMessage.java | 2 +- .../TcpDiscoveryNodeFailedMessage.java | 2 +- .../messages/TcpDiscoveryNodeLeftMessage.java | 2 +- .../spi/tracing/NoopSpiSpecificSpan.java | 4 + .../ignite/spi/tracing/NoopTracingSpi.java | 7 +- .../ignite/spi/tracing/SpiSpecificSpan.java | 4 + .../TracingConfigurationCoordinates.java | 26 + .../tracing/TracingConfigurationManager.java | 4 + .../TracingConfigurationParameters.java | 31 +- .../apache/ignite/spi/tracing/TracingSpi.java | 4 + .../TestRecordingCommunicationSpi.java | 20 +- .../ClientSlowDiscoveryAbstractTest.java | 2 - ...shallerCacheClientRequestsMappingTest.java | 4 - ...IgniteSequentialNodeCrashRecoveryTest.java | 2 - .../IncrementalSnapshotJoiningClientTest.java | 2 - .../schema/IndexWithSameNameTestBase.java | 2 - .../discovery/tcp/BlockTcpDiscoverySpi.java | 2 - .../discovery/tcp/TcpDiscoverySelfTest.java | 2 - ...mmandHandlerClusterByClassTest_help.output | 66 - ...ndlerClusterByClassWithSSLTest_help.output | 66 - .../processors/query/h2/CommandProcessor.java | 2 +- .../processors/query/h2/H2FieldsIterator.java | 7 +- .../query/h2/H2ResultSetIterator.java | 25 +- .../processors/query/h2/IgniteH2Indexing.java | 182 ++- .../processors/query/h2/QueryParser.java | 16 +- .../query/h2/RegisteredQueryCursor.java | 61 +- .../query/h2/database/H2TreeIndex.java | 181 ++- .../query/h2/dml/DmlBatchSender.java | 35 +- .../processors/query/h2/dml/DmlUtils.java | 39 +- .../query/h2/twostep/AbstractReducer.java | 53 +- .../h2/twostep/GridMapQueryExecutor.java | 233 ++-- .../h2/twostep/GridReduceQueryExecutor.java | 106 +- .../query/h2/twostep/ReduceIndexIterator.java | 17 +- .../internal/processors/tracing/MTC.java | 114 -- .../internal/processors/tracing/NoopSpan.java | 74 -- .../processors/tracing/NoopSpanManager.java | 58 - .../internal/processors/tracing/Span.java | 85 -- .../processors/tracing/SpanManager.java | 80 -- .../internal/processors/tracing/SpanTags.java | 127 -- .../internal/processors/tracing/SpanType.java | 329 ----- .../tracing/messages/SpanTransport.java | 35 - .../internal/util/nio/GridNioServer.java | 160 +-- .../util/nio/GridNioTracerFilter.java | 126 -- .../util/nio/GridSelectorNioSessionImpl.java | 14 - .../util/nio/SessionWriteRequest.java | 8 - modules/opencensus/pom.xml | 13 - .../exporter/trace/TimeLimitedHandler.java | 146 --- .../opencensus/OpenCensusSpanAdapter.java | 82 -- .../opencensus/OpenCensusTraceExporter.java | 68 -- .../opencensus/OpenCensusTracingSpi.java | 159 --- .../tracing/opencensus/StatusMatchTable.java | 56 - .../spi/tracing/opencensus/package-info.java | 22 - .../TracingConfigurationValidationTest.java | 122 -- .../opencensus/AbstractTracingTest.java | 507 -------- .../opencensus/IgniteOpenCensusSuite.java | 15 +- .../opencensus/MixedTracingSpiTest.java | 126 -- .../OpenCensusDiscoveryTracingTest.java | 339 ------ .../OpenCensusSqlJdbcTracingTest.java | 222 ---- .../OpenCensusSqlNativeTracingTest.java | 787 ------------ ...nCensusTracingConfigurationGetAllTest.java | 106 -- ...OpenCensusTracingConfigurationGetTest.java | 149 --- ...ensusTracingConfigurationResetAllTest.java | 98 -- ...enCensusTracingConfigurationResetTest.java | 154 --- .../opencensus/OpenCensusTracingSpiTest.java | 374 ------ .../OpenCensusTxTracingConfigurationTest.java | 294 ----- .../opencensus/OpenCensusTxTracingTest.java | 1084 ----------------- .../zk/internal/ZookeeperDiscoveryImpl.java | 10 +- 157 files changed, 1823 insertions(+), 12886 deletions(-) delete mode 100644 docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/Tracing.java delete mode 100644 docs/_docs/code-snippets/xml/tracing.xml delete mode 100644 docs/_docs/monitoring-metrics/tracing.adoc delete mode 100644 modules/benchmarks/src/main/java/org/apache/ignite/internal/benchmarks/jmh/misc/JmhTracingContextBenchmark.java delete mode 100644 modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerTracingConfigurationTest.java delete mode 100644 modules/core/src/main/java/org/apache/ignite/internal/management/tracing/AbstractTracingConfigurationCommand.java delete mode 100644 modules/core/src/main/java/org/apache/ignite/internal/management/tracing/TracingConfigurationCommand.java delete mode 100644 modules/core/src/main/java/org/apache/ignite/internal/management/tracing/TracingConfigurationGetAllCommand.java delete mode 100644 modules/core/src/main/java/org/apache/ignite/internal/management/tracing/TracingConfigurationGetAllCommandArg.java delete mode 100644 modules/core/src/main/java/org/apache/ignite/internal/management/tracing/TracingConfigurationGetCommand.java delete mode 100644 modules/core/src/main/java/org/apache/ignite/internal/management/tracing/TracingConfigurationGetCommandArg.java delete mode 100644 modules/core/src/main/java/org/apache/ignite/internal/management/tracing/TracingConfigurationItem.java delete mode 100644 modules/core/src/main/java/org/apache/ignite/internal/management/tracing/TracingConfigurationResetAllCommand.java delete mode 100644 modules/core/src/main/java/org/apache/ignite/internal/management/tracing/TracingConfigurationResetCommand.java delete mode 100644 modules/core/src/main/java/org/apache/ignite/internal/management/tracing/TracingConfigurationSetCommand.java delete mode 100644 modules/core/src/main/java/org/apache/ignite/internal/management/tracing/TracingConfigurationSetCommandArg.java delete mode 100644 modules/core/src/main/java/org/apache/ignite/internal/management/tracing/TracingConfigurationTask.java delete mode 100644 modules/core/src/main/java/org/apache/ignite/internal/management/tracing/TracingConfigurationTaskResult.java delete mode 100644 modules/core/src/main/java/org/apache/ignite/internal/managers/communication/TraceRunnable.java delete mode 100644 modules/core/src/main/java/org/apache/ignite/internal/managers/tracing/GridTracingManager.java delete mode 100644 modules/core/src/main/java/org/apache/ignite/internal/processors/tracing/DeferredSpan.java delete mode 100644 modules/core/src/main/java/org/apache/ignite/internal/processors/tracing/NoopTracing.java delete mode 100644 modules/core/src/main/java/org/apache/ignite/internal/processors/tracing/SpanImpl.java delete mode 100644 modules/core/src/main/java/org/apache/ignite/internal/processors/tracing/TraceableIterator.java delete mode 100644 modules/core/src/main/java/org/apache/ignite/internal/processors/tracing/Tracing.java delete mode 100644 modules/core/src/main/java/org/apache/ignite/internal/processors/tracing/configuration/DistributedTracingConfiguration.java delete mode 100644 modules/core/src/main/java/org/apache/ignite/internal/processors/tracing/configuration/GridTracingConfigurationManager.java delete mode 100644 modules/core/src/main/java/org/apache/ignite/internal/processors/tracing/messages/SpanContainer.java delete mode 100644 modules/core/src/main/java/org/apache/ignite/internal/processors/tracing/messages/TraceableMessage.java delete mode 100644 modules/core/src/main/java/org/apache/ignite/internal/processors/tracing/messages/TraceableMessagesHandler.java delete mode 100644 modules/core/src/main/java/org/apache/ignite/internal/processors/tracing/messages/TraceableMessagesTable.java delete mode 100644 modules/core/src/main/java/org/apache/ignite/internal/tracing/TracingSpiType.java delete mode 100644 modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryAbstractTraceableMessage.java delete mode 100644 modules/nio/src/main/java/org/apache/ignite/internal/processors/tracing/MTC.java delete mode 100644 modules/nio/src/main/java/org/apache/ignite/internal/processors/tracing/NoopSpan.java delete mode 100644 modules/nio/src/main/java/org/apache/ignite/internal/processors/tracing/NoopSpanManager.java delete mode 100644 modules/nio/src/main/java/org/apache/ignite/internal/processors/tracing/Span.java delete mode 100644 modules/nio/src/main/java/org/apache/ignite/internal/processors/tracing/SpanManager.java delete mode 100644 modules/nio/src/main/java/org/apache/ignite/internal/processors/tracing/SpanTags.java delete mode 100644 modules/nio/src/main/java/org/apache/ignite/internal/processors/tracing/SpanType.java delete mode 100644 modules/nio/src/main/java/org/apache/ignite/internal/processors/tracing/messages/SpanTransport.java delete mode 100644 modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioTracerFilter.java delete mode 100644 modules/opencensus/src/main/java/io/opencensus/exporter/trace/TimeLimitedHandler.java delete mode 100644 modules/opencensus/src/main/java/org/apache/ignite/spi/tracing/opencensus/OpenCensusSpanAdapter.java delete mode 100644 modules/opencensus/src/main/java/org/apache/ignite/spi/tracing/opencensus/OpenCensusTraceExporter.java delete mode 100644 modules/opencensus/src/main/java/org/apache/ignite/spi/tracing/opencensus/OpenCensusTracingSpi.java delete mode 100644 modules/opencensus/src/main/java/org/apache/ignite/spi/tracing/opencensus/StatusMatchTable.java delete mode 100644 modules/opencensus/src/main/java/org/apache/ignite/spi/tracing/opencensus/package-info.java delete mode 100644 modules/opencensus/src/test/java/org/apache/ignite/TracingConfigurationValidationTest.java delete mode 100644 modules/opencensus/src/test/java/org/apache/ignite/internal/processors/monitoring/opencensus/AbstractTracingTest.java delete mode 100644 modules/opencensus/src/test/java/org/apache/ignite/internal/processors/monitoring/opencensus/MixedTracingSpiTest.java delete mode 100644 modules/opencensus/src/test/java/org/apache/ignite/internal/processors/monitoring/opencensus/OpenCensusDiscoveryTracingTest.java delete mode 100644 modules/opencensus/src/test/java/org/apache/ignite/internal/processors/monitoring/opencensus/OpenCensusSqlJdbcTracingTest.java delete mode 100644 modules/opencensus/src/test/java/org/apache/ignite/internal/processors/monitoring/opencensus/OpenCensusSqlNativeTracingTest.java delete mode 100644 modules/opencensus/src/test/java/org/apache/ignite/internal/processors/monitoring/opencensus/OpenCensusTracingConfigurationGetAllTest.java delete mode 100644 modules/opencensus/src/test/java/org/apache/ignite/internal/processors/monitoring/opencensus/OpenCensusTracingConfigurationGetTest.java delete mode 100644 modules/opencensus/src/test/java/org/apache/ignite/internal/processors/monitoring/opencensus/OpenCensusTracingConfigurationResetAllTest.java delete mode 100644 modules/opencensus/src/test/java/org/apache/ignite/internal/processors/monitoring/opencensus/OpenCensusTracingConfigurationResetTest.java delete mode 100644 modules/opencensus/src/test/java/org/apache/ignite/internal/processors/monitoring/opencensus/OpenCensusTracingSpiTest.java delete mode 100644 modules/opencensus/src/test/java/org/apache/ignite/internal/processors/monitoring/opencensus/OpenCensusTxTracingConfigurationTest.java delete mode 100644 modules/opencensus/src/test/java/org/apache/ignite/internal/processors/monitoring/opencensus/OpenCensusTxTracingTest.java diff --git a/checkstyle/checkstyle-suppressions.xml b/checkstyle/checkstyle-suppressions.xml index 9a40f8d4b725a..0b6d14c332dc4 100644 --- a/checkstyle/checkstyle-suppressions.xml +++ b/checkstyle/checkstyle-suppressions.xml @@ -60,9 +60,6 @@ - - diff --git a/docs/_data/toc.yaml b/docs/_data/toc.yaml index e8a6eefc570b6..11cd73ae1c9eb 100644 --- a/docs/_data/toc.yaml +++ b/docs/_data/toc.yaml @@ -450,8 +450,6 @@ url: monitoring-metrics/system-views - title: Performance Statistics url: monitoring-metrics/performance-statistics - - title: Tracing - url: monitoring-metrics/tracing - title: Working with Events items: - title: Enabling and Listenting to Events diff --git a/docs/_docs/code-snippets/java/pom.xml b/docs/_docs/code-snippets/java/pom.xml index a67910da040b2..6f8f739ee2a4b 100644 --- a/docs/_docs/code-snippets/java/pom.xml +++ b/docs/_docs/code-snippets/java/pom.xml @@ -100,11 +100,6 @@ ${project.groupId} ignite-opencensus - - io.opencensus - opencensus-exporter-trace-zipkin - 0.31.1 - ${project.groupId} diff --git a/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/Tracing.java b/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/Tracing.java deleted file mode 100644 index d62ee3f04c20b..0000000000000 --- a/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/Tracing.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.ignite.snippets; - -import org.apache.ignite.Ignite; -import org.apache.ignite.IgniteCache; -import org.apache.ignite.IgniteTransactions; -import org.apache.ignite.Ignition; -import org.apache.ignite.cache.CacheAtomicityMode; -import org.apache.ignite.configuration.CacheConfiguration; -import org.apache.ignite.configuration.IgniteConfiguration; -import org.apache.ignite.spi.tracing.Scope; -import org.apache.ignite.spi.tracing.TracingConfigurationCoordinates; -import org.apache.ignite.spi.tracing.TracingConfigurationParameters; -import org.apache.ignite.transactions.Transaction; -import org.junit.jupiter.api.Test; - -import io.opencensus.exporter.trace.zipkin.ZipkinExporterConfiguration; -import io.opencensus.exporter.trace.zipkin.ZipkinTraceExporter; - -public class Tracing { - - @Test - void config() { - //tag::config[] - IgniteConfiguration cfg = new IgniteConfiguration(); - - cfg.setTracingSpi(new org.apache.ignite.spi.tracing.opencensus.OpenCensusTracingSpi()); - - Ignite ignite = Ignition.start(cfg); - //end::config[] - - ignite.close(); - } - - @Test - void enableSampling() { - //tag::enable-sampling[] - Ignite ignite = Ignition.start(); - - ignite.tracingConfiguration().set( - new TracingConfigurationCoordinates.Builder(Scope.TX).build(), - new TracingConfigurationParameters.Builder().withSamplingRate(1).build()); - - //end::enable-sampling[] - ignite.close(); - } - - void exportToZipkin() { - //tag::export-to-zipkin[] - //register Zipkin exporter - ZipkinTraceExporter.createAndRegister( - ZipkinExporterConfiguration.builder().setV2Url("http://localhost:9411/api/v2/spans") - .setServiceName("ignite-cluster").build()); - - IgniteConfiguration cfg = new IgniteConfiguration().setClientMode(true) - .setTracingSpi(new org.apache.ignite.spi.tracing.opencensus.OpenCensusTracingSpi()); - - Ignite ignite = Ignition.start(cfg); - - //enable trace sampling for transactions with 100% sampling rate - ignite.tracingConfiguration().set( - new TracingConfigurationCoordinates.Builder(Scope.TX).build(), - new TracingConfigurationParameters.Builder().withSamplingRate(1).build()); - - //create a transactional cache - IgniteCache cache = ignite - .getOrCreateCache(new CacheConfiguration("myCache") - .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL)); - - IgniteTransactions transactions = ignite.transactions(); - - // start a transaction - try (Transaction tx = transactions.txStart()) { - //do some operations - cache.put(1, "test value"); - - System.out.println(cache.get(1)); - - cache.put(1, "second value"); - - tx.commit(); - } - - try { - //This code here is to wait until the trace is exported to Zipkin. - //If your application doesn't stop here, you don't need this piece of code. - Thread.sleep(5_000); - } catch (InterruptedException e) { - e.printStackTrace(); - } - - //end::export-to-zipkin[] - ignite.close(); - } -} diff --git a/docs/_docs/code-snippets/xml/tracing.xml b/docs/_docs/code-snippets/xml/tracing.xml deleted file mode 100644 index ff510719879e4..0000000000000 --- a/docs/_docs/code-snippets/xml/tracing.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - 127.0.0.1:47500..47509 - - - - - - - - - - diff --git a/docs/_docs/key-value-api/transactions.adoc b/docs/_docs/key-value-api/transactions.adoc index 646691a09e3ee..2297e1e9a2502 100644 --- a/docs/_docs/key-value-api/transactions.adoc +++ b/docs/_docs/key-value-api/transactions.adoc @@ -357,6 +357,4 @@ tab:C++[unsupported] Refer to the link:monitoring-metrics/new-metrics-system#monitoring-transactions[Monitoring Transactions] section for the list of metrics that expose some transaction-related information. -For the information on how to trace transactions, refer to the link:monitoring-metrics/tracing[Tracing] section. - You can also use the link:tools/control-script#transaction-management[control script] to get information about, or cancel, specific transactions being executed in the cluster. diff --git a/docs/_docs/monitoring-metrics/tracing.adoc b/docs/_docs/monitoring-metrics/tracing.adoc deleted file mode 100644 index aa10768058036..0000000000000 --- a/docs/_docs/monitoring-metrics/tracing.adoc +++ /dev/null @@ -1,240 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -= Tracing - -:javaFile: {javaCodeDir}/Tracing.java - -A number of APIs in Ignite are instrumented for tracing with OpenCensus. -You can collect distributed traces of various tasks executed in your cluster and use this information to diagnose latency problems. - -We suggest you get familiar with OpenCensus tracing documentation before reading this chapter: https://opencensus.io/tracing/[^]. - -The following Ignite APIs are instrumented for tracing: - -* Discovery -* Communication -* Exchange -* Transactions -* SQL queries - - -To view traces, you must export them into an external system. -You can use one of the OpenCensus exporters or write your own, but in any case, you will have to write code that registers an exporter in Ignite. -Refer to <> for details. - - -== Configuring Tracing - -Enable OpenCensus tracing in the node configuration. All nodes in the cluster must use the same tracing configuration. - -[tabs] --- -tab:XML[] -[source, xml] ----- -include::code-snippets/xml/tracing.xml[tags=ignite-config;!discovery, indent=0] ----- - -tab:Java[] -[source, java] ----- -include::{javaFile}[tags=config, indent=0] ----- -tab:C#/.NET[] - -tab:C++[unsupported] --- - - -== Enabling Trace Sampling - -When you start your cluster with the above configuration, Ignite does not collect traces. -You have to enable trace sampling for a specific API at runtime. -You can turn trace sampling on and off at will, for example, only for the period when you are troubleshooting a problem. - -You can do this in two ways: - -* via the control script from the command line -* programmatically - -Traces are collected at a given probabilistic sampling rate. -The rate is specified as a value between 0.0 and 1.0 inclusive: `0` means no sampling, `1` means always sampling. - -When the sampling rate is set to a value greater than 0, Ignite collects traces. -To disable trace collection, set the sampling rate to 0. - -The following sections describe the two ways of enabling trace sampling. - -=== Using Control Script - -Go to the `{IGNITE_HOME}/bin` directory of your Ignite installation. - -Enable tracing for a specific API: - -[source, shell] ----- -./control.sh --tracing-configuration set --scope TX --sampling-rate 1 ----- - -Refer to the link:tools/control-script#tracing-configuration[Control Script] sections for the list of all parameters. - -=== Programmatically - -Once you start the node, you can enable trace sampling as follows: - -[source, java] ----- -include::{javaFile}[tags=enable-sampling, indent=0] ----- - - -The `--scope` parameter specifies the API you want to trace. -The following APIs are instrumented for tracing: - -* `DISCOVERY` — discovery events -* `EXCHANGE` — exchange events -* `COMMUNICATION` — communication events -* `TX` — transactions -* `SQL` — SQL queries - -The `--sampling-rate` is the probabilistic sampling rate, a number between `0` and `1`: - -* `0` means no sampling, -* `1` means always sampling. - - -== Exporting Traces - -To view traces, you need to export them to an external backend using one of the available exporters. -OpenCensus supports a number of exporters out-of-the-box, and you can write a custom one. -Refer to the link:https://opencensus.io/exporters/[OpenCensus Exporters^] for details. - -In this section, we will show how to export traces to link:https://zipkin.io[Zipkin^]. - -. Follow link:https://zipkin.io/pages/quickstart.html[this guide^] to launch Zipkin on your machine. -. Register `ZipkinTraceExporter` in the application where you start Ignite: -+ --- -[source, java] ----- -include::{javaFile}[tags=export-to-zipkin, indent=0] ----- --- - - -. Open http://localhost:9411/zipkin[^] in your browser and click the search icon. -+ --- -This is what a trace of the transaction looks like: - -image::images/trace_in_zipkin.png[] --- - -== Analyzing Trace Data - -A trace is recorded information about the execution of a specific event. -Each trace consists of a tree of _spans_. -A span is an individual unit of work performed by the system in order to process the event. - -Because of the distributed nature of Ignite, an operation usually involves multiple nodes. -Therefore, a trace can include spans from multiple nodes. -Each span always contains the information about the node where the corresponding operation was executed. - -In the image of the transaction trace presented above, you can see that the trace contains the spans associated with the following operations: - -* acquire locks (`transactions.colocated.lock.map`), -* get (`transactions.near.enlist.read`), -* put (`transactions.near.enlist.write`), -* commit (`transactions.commit`), and -* close (`transactions.close`). - -The commit operation, in turn, consists of two operations: prepare and finish. - -You can click on each span to view the annotations and tags attached to it. - - -image::images/span.png[Span] - - -== Tracing SQL Queries - -To enable SQL queries tracing, use `SQL` as a value of the `scope` parameter during the link:https://ignite.apache.org/docs/latest/monitoring-metrics/tracing#enabling-trace-sampling[trace sampling configuration, window=_blank]. -If tracing of SQL queries is enabled, execution of each SQL query on any cluster node will produce a separate trace. - -[IMPORTANT] -==== -[discrete] -Enabling tracing for SQL queries imposes a severe degradation on SQL engine performance. -==== - -The table below provides descriptions, a list of tags, and annotations for each span that can be a part of the SQL query trace tree. - -[NOTE] -==== -[discrete] -Depending on the SQL query type and its execution plan, some spans may not be present in the SQL query span tree. -==== - -[cols="2,5,5",opts="header"] -|=== -|Span Name | Description | Tags and Annotations -| sql.query | Execution of an SQL query from the moment of registration until the used resources on the query initiator node are released a| -* sql.query.text - SQL query text -* sql.schema - SQL schema -| sql.cursor.open | SQL query cursor opening | -| sql.cursor.close | SQL query cursor closure | -| sql.cursor.cancel | SQL query cursor cancellation | -| sql.query.parse | Parsing of SQL query a| -* sql.parser.cache.hit - Whether parsing of the SQL query was skipped due to the cached result -| sql.query.execute.request | Processing of SQL query execution request a| -* sql.query.text - SQL query text -| sql.next.page.request | Processing of the request for obtaining the next page of local SQL query execution result | -| sql.page.response | Processing of the message with a node local SQL query execution result page | -| sql.query.execute | Execution of query by H2 SQL engine a| -* sql.query.text - SQL query text -| sql.page.prepare | Reading rows from the cursor and preparing a result page a| -* sql.page.rows - Number of rows that a result page contains -| sql.fail.response | Processing of a message that indicates failure of SQL query execution | -| sql.dml.query.execute.request | Processing of SQL DML query execution request a| -* sql.query.text - SQL query text -| sql.dml.query.response | Processing of SQL DML query execution result by query initiator node | -| sql.query.cancel.request | Processing of SQL query cancel request | -| sql.iterator.open | SQL query iterator opening | -| sql.iterator.close | SQL query iterator closure | -| sql.page.fetch | Fetching SQL query result page a| -* sql.page.rows - Number of rows that result page contains -| sql.page.wait | Waiting for SQL query results page to be received from remote node | -| sql.index.range.request | Processing SQL index range request a| -* sql.index - SQL index name -* sql.table - SQL table name -* sql.index.range.rows - Number of rows that an index range request result contains -| sql.index.range.response | Processing SQL index range responce | -| sql.dml.query.execute | Execution of SQL DML query | -| sql.command.query.execute | Execution of an SQL command query, which is either a DDL query or an Ignite native command | -| sql.partitions.reserve | Reservation of data partitions used to execute a query a| -* Annotation message that indicates reservation of data partitions for a particular cache - `Cache partitions were reserved [cache=, partitions=[]` -| sql.cache.update | Cache update as a result of SQL DML query execution a| -* sql.cache.updates - Number of cache entries to be updated as a result of DML query -| sql.batch.process| Processing of SQL batch update | -|=== - -//// -TODO: describe annotations and tags -=== Annotations - -=== Tags - -The `node.id` and `node.consistentId` are the ID and consistent ID of the node where the root operation started. -//// diff --git a/docs/_docs/tools/control-script.adoc b/docs/_docs/tools/control-script.adoc index 445e6e2b19b49..2c0ed77f4d8b4 100644 --- a/docs/_docs/tools/control-script.adoc +++ b/docs/_docs/tools/control-script.adoc @@ -907,72 +907,6 @@ Index(es): [8327bbd1-df08-4b97-8721-de95e363e745] inline size: 2 ---- -== Tracing Configuration - -You can enable or disable sampling of traces for a specific API by using the `--tracing-configuration` command. -Refer to the link:monitoring-metrics/tracing[Tracing] section for details. - -To view the current tracing configuration, execute the following command: - -[source, shell] ----- -control.sh --tracing-configuration ----- - -To enable trace sampling for a specific API: - - -[source, shell] ----- -control.sh --tracing-configuration set --scope --sampling-rate --label