-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial implementation of OpenTelemetryRum (#378)
- Loading branch information
Mateusz Rzeszutek
authored
Oct 30, 2022
1 parent
73725ce
commit 3d91ee1
Showing
30 changed files
with
926 additions
and
265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
277 changes: 141 additions & 136 deletions
277
splunk-otel-android/src/main/java/com/splunk/rum/RumInitializer.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...otel-android/src/main/java/io/opentelemetry/rum/internal/InstrumentedApplicationImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright Splunk Inc. | ||
* | ||
* Licensed 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 io.opentelemetry.rum.internal; | ||
|
||
import android.app.Application; | ||
import io.opentelemetry.rum.internal.instrumentation.ApplicationStateListener; | ||
import io.opentelemetry.rum.internal.instrumentation.InstrumentedApplication; | ||
import io.opentelemetry.sdk.OpenTelemetrySdk; | ||
|
||
final class InstrumentedApplicationImpl implements InstrumentedApplication { | ||
|
||
private final Application application; | ||
private final OpenTelemetrySdk openTelemetrySdk; | ||
private final ApplicationStateWatcher applicationStateWatcher; | ||
|
||
InstrumentedApplicationImpl( | ||
Application application, | ||
OpenTelemetrySdk openTelemetrySdk, | ||
ApplicationStateWatcher applicationStateWatcher) { | ||
this.application = application; | ||
this.openTelemetrySdk = openTelemetrySdk; | ||
this.applicationStateWatcher = applicationStateWatcher; | ||
} | ||
|
||
@Override | ||
public Application getApplication() { | ||
return application; | ||
} | ||
|
||
@Override | ||
public OpenTelemetrySdk getOpenTelemetrySdk() { | ||
return openTelemetrySdk; | ||
} | ||
|
||
@Override | ||
public void registerApplicationStateListener(ApplicationStateListener listener) { | ||
applicationStateWatcher.registerListener(listener); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/OpenTelemetryRum.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright Splunk Inc. | ||
* | ||
* Licensed 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 io.opentelemetry.rum.internal; | ||
|
||
import io.opentelemetry.api.OpenTelemetry; | ||
|
||
/** | ||
* Entrypoint for the OpenTelemetry Real User Monitoring library for Android. | ||
* | ||
* <p>This class is internal and is hence not for public use. Its APIs are unstable and can change | ||
* at any time. | ||
*/ | ||
public interface OpenTelemetryRum { | ||
|
||
/** Returns a new {@link OpenTelemetryRumBuilder} for {@link OpenTelemetryRum}. */ | ||
static OpenTelemetryRumBuilder builder() { | ||
return new OpenTelemetryRumBuilder(); | ||
} | ||
|
||
/** Returns a no-op implementation of {@link OpenTelemetryRum}. */ | ||
static OpenTelemetryRum noop() { | ||
return NoopOpenTelemetryRum.INSTANCE; | ||
} | ||
|
||
/** | ||
* Get a handle to the instance of the {@linkplain OpenTelemetry OpenTelemetry API} that this | ||
* instance is using for instrumentation. | ||
*/ | ||
OpenTelemetry getOpenTelemetry(); | ||
|
||
/** | ||
* Get the client session ID associated with this instance of the RUM instrumentation library. | ||
* Note: this value will change throughout the lifetime of an application instance, so it is | ||
* recommended that you do not cache this value, but always retrieve it from here when needed. | ||
*/ | ||
String getRumSessionId(); | ||
} |
Oops, something went wrong.