-
Notifications
You must be signed in to change notification settings - Fork 98
[controller] integrate OpenTelemetry into Controller & add log compaction metrics #1665
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
base: main
Are you sure you want to change the base?
Changes from all commits
08af724
0e02387
7f976b6
afa726d
c979a9f
7655f14
8f3d55b
2a86ec0
6b679d4
d415a71
69c1743
e08f1e8
55fd989
1a39ced
301ce62
e9f3afa
36d69bc
77eb063
7e92b84
55f6247
4915107
86e4f32
1caf418
80032f0
6d11f0b
2062312
a78dff5
76be48e
dccf750
3b918b0
d48b396
d1c0a2f
522ff6f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.linkedin.venice.stats.dimensions; | ||
|
||
public enum JobRunStatus implements VeniceDimensionInterface { | ||
FAILED, SUCCESS; | ||
|
||
private final String status; | ||
|
||
JobRunStatus() { | ||
this.status = name().toLowerCase(); | ||
} | ||
|
||
/** | ||
* All the instances of this Enum should have the same dimension name. | ||
* Refer {@link VeniceDimensionInterface#getDimensionName()} for more details. | ||
*/ | ||
@Override | ||
public VeniceMetricsDimensions getDimensionName() { | ||
return VeniceMetricsDimensions.JOB_EXECUTION_STATUS; | ||
} | ||
|
||
@Override | ||
public String getDimensionValue() { | ||
return this.status; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.linkedin.venice.stats.dimensions; | ||
|
||
public enum LogCompactionSelectionReason implements VeniceDimensionInterface { | ||
TIME_SINCE_LAST_VERSION_CREATION_EXCEEDS_THRESHOLD; | ||
|
||
private final String reason; | ||
|
||
LogCompactionSelectionReason() { | ||
this.reason = name().toLowerCase(); | ||
} | ||
|
||
/** | ||
* All the instances of this Enum should have the same dimension name. | ||
* Refer {@link VeniceDimensionInterface#getDimensionName()} for more details. | ||
*/ | ||
@Override | ||
public VeniceMetricsDimensions getDimensionName() { | ||
return VeniceMetricsDimensions.LOG_COMPACTION_SELECTION_REASON; | ||
} | ||
|
||
@Override | ||
public String getDimensionValue() { | ||
return this.reason; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.linkedin.venice.stats.dimensions; | ||
|
||
public enum RepushStoreTriggerSource implements VeniceDimensionInterface { | ||
MANUAL, SCHEDULED; | ||
|
||
private final String triggerSource; | ||
|
||
RepushStoreTriggerSource() { | ||
this.triggerSource = name().toLowerCase(); | ||
} | ||
|
||
/** | ||
* All the instances of this Enum should have the same dimension name. | ||
* Refer {@link VeniceDimensionInterface#getDimensionName()} for more details. | ||
*/ | ||
@Override | ||
public VeniceMetricsDimensions getDimensionName() { | ||
return VeniceMetricsDimensions.REPUSH_STORE_TRIGGER_SOURCE; | ||
} | ||
|
||
@Override | ||
public String getDimensionValue() { | ||
return this.triggerSource; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,7 @@ dependencies { | |
|
||
implementation project(':internal:venice-common') | ||
implementation project(':clients:venice-thin-client') | ||
implementation project(':internal:venice-client-common') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this not under venice-common rather than under venice-client-common. We can fix this if needed separately, no AI for you on this. |
||
|
||
implementation libraries.commonsIo | ||
implementation libraries.fastUtil | ||
|
@@ -43,11 +44,13 @@ dependencies { | |
implementation libraries.spark | ||
// It's necessary to pull in the most recent version of zkclient explicitly, otherwise Helix won't have it... | ||
implementation libraries.zkclient | ||
implementation libraries.opentelemetryApi | ||
|
||
testImplementation project(':services:venice-router') | ||
testImplementation libraries.avroUtilFastserde | ||
testImplementation libraries.kafkaClientsTest // TODO: Get rid of Kafka dependency in venice-common (used by TopicCreator) | ||
testImplementation project(':internal:venice-test-common') | ||
testImplementation libraries.openTelemetryTestSdk | ||
} | ||
|
||
jar { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
import com.linkedin.venice.controller.server.AdminSparkServer; | ||
import com.linkedin.venice.controller.server.VeniceControllerGrpcServiceImpl; | ||
import com.linkedin.venice.controller.server.VeniceControllerRequestHandler; | ||
import com.linkedin.venice.controller.stats.ControllerMetricEntity; | ||
import com.linkedin.venice.controller.stats.DeferredVersionSwapStats; | ||
import com.linkedin.venice.controller.stats.TopicCleanupServiceStats; | ||
import com.linkedin.venice.controller.supersetschema.SupersetSchemaGenerator; | ||
|
@@ -35,6 +36,7 @@ | |
import com.linkedin.venice.service.ICProvider; | ||
import com.linkedin.venice.servicediscovery.AsyncRetryingServiceDiscoveryAnnouncer; | ||
import com.linkedin.venice.servicediscovery.ServiceDiscoveryAnnouncer; | ||
import com.linkedin.venice.stats.metrics.MetricEntity; | ||
import com.linkedin.venice.system.store.ControllerClientBackedSystemSchemaInitializer; | ||
import com.linkedin.venice.utils.LogContext; | ||
import com.linkedin.venice.utils.PropertyBuilder; | ||
|
@@ -46,10 +48,13 @@ | |
import io.grpc.ServerInterceptor; | ||
import io.tehuti.metrics.MetricsRepository; | ||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
import java.util.Collection; | ||
import java.util.Collections; | ||
import java.util.List; | ||
import java.util.Optional; | ||
import java.util.concurrent.ThreadPoolExecutor; | ||
import java.util.stream.Collectors; | ||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
|
||
|
@@ -61,6 +66,11 @@ public class VeniceController { | |
private static final Logger LOGGER = LogManager.getLogger(VeniceController.class); | ||
private static final String CONTROLLER_GRPC_SERVER_THREAD_NAME = "ControllerGrpcServer"; | ||
static final String CONTROLLER_SERVICE_NAME = "venice-controller"; | ||
public static final String CONTROLLER_SERVICE_METRIC_PREFIX = "controller"; | ||
public static final Collection<MetricEntity> CONTROLLER_SERVICE_METRIC_ENTITIES = Collections.unmodifiableList( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why duplicated? |
||
Arrays.stream(ControllerMetricEntity.values()) | ||
.map(ControllerMetricEntity::getMetricEntity) | ||
.collect(Collectors.toList())); | ||
|
||
// services | ||
private final VeniceControllerService controllerService; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there another reason which we are thinking to add in the future?