Skip to content

Commit 5a827d4

Browse files
committed
latest
1 parent a26048b commit 5a827d4

File tree

3 files changed

+50
-75
lines changed

3 files changed

+50
-75
lines changed

config/spp-platform.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
spp-platform:
2-
host: 0.0.0.0
3-
port: 5445
4-
access_token: "change-me"
2+
host: ${SPP_PLATFORM_HOST:-0.0.0.0}
3+
port: ${SPP_PLATFORM_PORT:-5445}
4+
access_token: ${SPP_SYSTEM_ACCESS_TOKEN:-change-me}
55
logging:
6-
level: info
6+
level: ${SPP_LOGGING_LEVEL:-info}
77
probe:
8-
bridge_port: 5450
8+
bridge_port: ${SPP_PROBE_BRIDGE_PORT:-5450}
99
marker:
10-
bridge_port: 5455
10+
bridge_port: ${SPP_MARKER_BRIDGE_PORT:-5455}
1111
processor:
12-
bridge_port: 5460
12+
bridge_port: ${SPP_PROCESSOR_BRIDGE_PORT:-5460}
1313

14-
redis:
15-
host: localhost
16-
port: 6379
14+
storage:
15+
selector: ${SPP_STORAGE:-memory}
1716

1817
skywalking-oap:
19-
host: localhost
20-
port: 12800
18+
host: ${SPP_OAP_HOST:-localhost}
19+
port: ${SPP_OAP_PORT:-12800}

src/main/graphql/schema.json

Lines changed: 26 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,61 +1626,46 @@
16261626
"name": null,
16271627
"ofType": {
16281628
"kind": "INPUT_OBJECT",
1629-
"name": "LiveSourceLocationInput",
1629+
"name": "LiveSpanLocationInput",
16301630
"ofType": null
16311631
}
16321632
},
16331633
"defaultValue": null
16341634
},
16351635
{
1636-
"name": "condition",
1637-
"description": null,
1638-
"type": {
1639-
"kind": "SCALAR",
1640-
"name": "String",
1641-
"ofType": null
1642-
},
1643-
"defaultValue": null
1644-
},
1645-
{
1646-
"name": "expiresAt",
1647-
"description": null,
1648-
"type": {
1649-
"kind": "SCALAR",
1650-
"name": "Long",
1651-
"ofType": null
1652-
},
1653-
"defaultValue": null
1654-
},
1655-
{
1656-
"name": "hitLimit",
1657-
"description": null,
1658-
"type": {
1659-
"kind": "SCALAR",
1660-
"name": "Int",
1661-
"ofType": null
1662-
},
1663-
"defaultValue": null
1664-
},
1665-
{
1666-
"name": "throttle",
1667-
"description": null,
1636+
"name": "meta",
1637+
"description": "condition: String #todo: impl\nexpiresAt: Long #todo: impl\nhitLimit: Int #todo: impl\nthrottle: InstrumentThrottleInput #todo: impl",
16681638
"type": {
1669-
"kind": "INPUT_OBJECT",
1670-
"name": "InstrumentThrottleInput",
1671-
"ofType": null
1639+
"kind": "LIST",
1640+
"name": null,
1641+
"ofType": {
1642+
"kind": "INPUT_OBJECT",
1643+
"name": "MetaInfoInput",
1644+
"ofType": null
1645+
}
16721646
},
16731647
"defaultValue": null
1674-
},
1648+
}
1649+
],
1650+
"interfaces": null,
1651+
"enumValues": null,
1652+
"possibleTypes": null
1653+
},
1654+
{
1655+
"kind": "INPUT_OBJECT",
1656+
"name": "LiveSpanLocationInput",
1657+
"description": null,
1658+
"fields": null,
1659+
"inputFields": [
16751660
{
1676-
"name": "meta",
1661+
"name": "source",
16771662
"description": null,
16781663
"type": {
1679-
"kind": "LIST",
1664+
"kind": "NON_NULL",
16801665
"name": null,
16811666
"ofType": {
1682-
"kind": "INPUT_OBJECT",
1683-
"name": "MetaInfoInput",
1667+
"kind": "SCALAR",
1668+
"name": "String",
16841669
"ofType": null
16851670
}
16861671
},

src/main/kotlin/spp/cli/commands/instrument/AddSpan.kt

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,39 @@
11
package spp.cli.commands.instrument
22

33
import com.apollographql.apollo3.api.CustomScalarAdapters
4-
import com.apollographql.apollo3.api.Optional
54
import com.apollographql.apollo3.api.json.MapJsonWriter
65
import com.github.ajalt.clikt.core.CliktCommand
76
import com.github.ajalt.clikt.parameters.arguments.argument
8-
import com.github.ajalt.clikt.parameters.options.default
9-
import com.github.ajalt.clikt.parameters.options.option
10-
import com.github.ajalt.clikt.parameters.types.enum
11-
import com.github.ajalt.clikt.parameters.types.int
12-
import com.github.ajalt.clikt.parameters.types.long
137
import kotlinx.coroutines.runBlocking
148
import spp.cli.Main
159
import spp.cli.PlatformCLI.apolloClient
1610
import spp.cli.PlatformCLI.echoError
1711
import spp.cli.protocol.instrument.AddLiveSpanMutation
1812
import spp.cli.protocol.instrument.adapter.AddLiveSpanMutation_ResponseAdapter.AddLiveSpan
19-
import spp.cli.protocol.type.InstrumentThrottleInput
20-
import spp.cli.protocol.type.LiveSourceLocationInput
2113
import spp.cli.protocol.type.LiveSpanInput
22-
import spp.cli.protocol.type.ThrottleStep
14+
import spp.cli.protocol.type.LiveSpanLocationInput
2315
import spp.cli.util.JsonCleaner
2416
import kotlin.system.exitProcess
2517

2618
class AddSpan : CliktCommand() {
2719

28-
val source by argument(help = "Qualified class name")
29-
val line by argument(help = "Line number").int()
20+
val source by argument(help = "Qualified function name")
3021
val operationName by argument(help = "Operation name")
31-
val condition by option("-condition", "-c", help = "Trigger condition")
32-
val expiresAt by option("-expiresAt", "-e", help = "Expiration time (epoch time [ms])").long()
33-
val hitLimit by option("-hitLimit", "-h", help = "Trigger hit limit").int()
34-
val throttleLimit by option("-throttleLimit", "-t", help = "Trigger throttle limit").int().default(1)
35-
val throttleStep by option("-throttleStep", "-s", help = "Trigger throttle step").enum<ThrottleStep>()
36-
.default(ThrottleStep.SECOND)
22+
// val condition by option("-condition", "-c", help = "Trigger condition")
23+
// val expiresAt by option("-expiresAt", "-e", help = "Expiration time (epoch time [ms])").long()
24+
// val hitLimit by option("-hitLimit", "-h", help = "Trigger hit limit").int()
25+
// val throttleLimit by option("-throttleLimit", "-t", help = "Trigger throttle limit").int().default(1)
26+
// val throttleStep by option("-throttleStep", "-s", help = "Trigger throttle step").enum<ThrottleStep>()
27+
// .default(ThrottleStep.SECOND)
3728

3829
override fun run() = runBlocking {
3930
val input = LiveSpanInput(
4031
operationName = operationName,
41-
location = LiveSourceLocationInput(source, line),
42-
condition = Optional.Present(condition),
43-
expiresAt = Optional.Present(expiresAt),
44-
hitLimit = Optional.Present(hitLimit),
45-
throttle = Optional.Present(InstrumentThrottleInput(throttleLimit, throttleStep))
32+
location = LiveSpanLocationInput(source),
33+
// condition = Optional.Present(condition),
34+
// expiresAt = Optional.Present(expiresAt),
35+
// hitLimit = Optional.Present(hitLimit),
36+
// throttle = Optional.Present(InstrumentThrottleInput(throttleLimit, throttleStep))
4637
)
4738
val response = try {
4839
apolloClient.mutation(AddLiveSpanMutation(input)).execute()

0 commit comments

Comments
 (0)