Skip to content

Commit

Permalink
order installers, filter components should be after configs (#384)
Browse files Browse the repository at this point in the history
  • Loading branch information
shashank11p authored Apr 27, 2023
1 parent c66faa5 commit 777d4b1
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,10 @@ public void beforeAgent(AutoConfiguredOpenTelemetrySdk autoConfiguredOpenTelemet
// resolves filter via service loader resolution
FilterRegistry.initialize(providerConfig, jarPaths, getClass().getClassLoader());
}

@Override
public int order() {
// Configs should be loaded before FilterComponents because filters use configs
return 1;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,10 @@ public class DataCaptureConfigInstaller implements BeforeAgentListener {
public void beforeAgent(AutoConfiguredOpenTelemetrySdk autoConfiguredOpenTelemetrySdk) {
ConfigProvider.get(getClass().getClassLoader());
}

@Override
public int order() {
// Configs should be loaded before FilterComponents because filters use configs
return 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,10 @@ public class InstrumentationConfigInstaller implements BeforeAgentListener {
public void beforeAgent(AutoConfiguredOpenTelemetrySdk autoConfiguredOpenTelemetrySdk) {
ConfigProvider.get(getClass().getClassLoader());
}

@Override
public int order() {
// Configs should be loaded before FilterComponents because filters use configs
return 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,10 @@ public class ReportingConfigInstaller implements BeforeAgentListener {
public void beforeAgent(AutoConfiguredOpenTelemetrySdk autoConfiguredOpenTelemetrySdk) {
ConfigProvider.get(getClass().getClassLoader());
}

@Override
public int order() {
// Configs should be loaded before FilterComponents because filters use configs
return 0;
}
}

0 comments on commit 777d4b1

Please sign in to comment.