Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
uses: actions/checkout@v2

- name: Setup Java Version
uses: actions/setup-java@v2
uses: actions/setup-java@v3.14.1
with:
java-version: ${{ matrix.java-version }}
distribution: ${{ matrix.java-distribution }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,30 @@
package com.megaease.easeagent.config;

import com.megaease.easeagent.plugin.utils.SystemEnv;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;

import java.lang.reflect.Field;
import java.util.Map;


public class OtelSdkConfigsTest {

@After
public void after() throws NoSuchFieldException, IllegalAccessException {
Field field = SystemEnv.class.getDeclaredField("ENVIRONMENTS");
field.setAccessible(true);
Object env = field.get(null);
field.setAccessible(false);
Map<String, String> envMap = (Map<String, String>) env;
envMap.remove("OTEL_RESOURCE_ATTRIBUTES");
envMap.remove("OTEL_SERVICE_NAME");
envMap.remove("OTEL_SERVICE_NAMESPACE");
System.clearProperty("otel.service.name");
System.clearProperty("otel.service.namespace");
}

@Test
public void updateEnvCfg() {
//value from system env "OTEL_RESOURCE_ATTRIBUTES
Expand Down
Loading