-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fe5d727
commit e2716be
Showing
41 changed files
with
1,961 additions
and
1,622 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Apollo Usage Reporting | ||
|
||
Apollo Kotlin Execution supports sending [operation and field reports](https://www.apollographql.com/docs/graphos/platform/insights/sending-operation-metrics) to GraphOS. | ||
|
||
> If you have a federated graph, see [ftv1](federation.md#tracing-ftv1) instead for how to send tracing information to the router. | ||
{style=note} | ||
|
||
## Sending usage reports | ||
|
||
Operation and field reports are sent using a protobuf protocol to `https://usage-reporting.api.apollographql.com/api/ingress/traces`. | ||
|
||
Apollo Kotlin collects, encodes and sends those reports using the `apollo-execution-monograph` artifact: | ||
|
||
```kotlin | ||
dependencies { | ||
// Add the Apollo monograph artifact | ||
implementation("com.apollographql.execution:apollo-execution-monograph:%latest_version%") | ||
} | ||
``` | ||
|
||
To enable reports, configure your `ExecutableSchema` with a `ApolloReportsInstrumentation` and matching `ApolloReportsContext`: | ||
|
||
```kotlin | ||
// Get your API key from the environment or secret manager | ||
val apolloKey = System.getenv("APOLLO_KEY") | ||
|
||
// Install the ApolloReportsInstrumentation in the executable schema | ||
val schema = ServiceExecutableSchemaBuilder() | ||
.addInstrumentation(ApolloReportsInstrumentation(apolloKey)) | ||
.build() | ||
|
||
// Create a new ApolloReportsContext() for each operation and use it through execution | ||
val reportsContext = ApolloReportsContext() | ||
val response = schema.execute(request, reportsContext) | ||
|
||
// The reports are sent in the background | ||
``` |
This file was deleted.
Oops, something went wrong.
27 changes: 0 additions & 27 deletions
27
apollo-execution-federation/api/apollo-execution-federation.api
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
apollo-execution-federation/api/apollo-execution-federation.klib.api
This file was deleted.
Oops, something went wrong.
40 changes: 0 additions & 40 deletions
40
...ation/src/commonMain/kotlin/com/apollographql/execution/federation/Ftv1Instrumentation.kt
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Module apollo-execution-monograph | ||
|
Oops, something went wrong.