Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
3ba28dc
WIP
marcingrzejszczak Nov 25, 2022
a2b0151
Polish
marcingrzejszczak Nov 28, 2022
64ccece
Moved the code around, added tags and layer setting
marcingrzejszczak Nov 29, 2022
6ac6b3f
Added scenario
marcingrzejszczak Nov 30, 2022
4f165d4
Merge branch 'main' into micrometer
marcingrzejszczak Nov 30, 2022
1458e9d
Merge branch 'main' into micrometer
marcingrzejszczak Dec 1, 2022
72e0c03
Polish
marcingrzejszczak Dec 1, 2022
e4f6164
Added e2e scenario for resttemplate + mvc with spring framework 6
marcingrzejszczak Dec 2, 2022
da3bfe2
Updated changes.md
marcingrzejszczak Dec 2, 2022
534d3f2
Updated the component number
marcingrzejszczak Dec 2, 2022
5f306e6
polish
marcingrzejszczak Dec 2, 2022
97c2fc7
Added missing headers + added test to CI
marcingrzejszczak Dec 3, 2022
20a9ef2
Fixed checkstyle
marcingrzejszczak Dec 3, 2022
0156eaa
Changed the link to micrometer - the other one is failing due to havi…
marcingrzejszczak Dec 3, 2022
07834e3
Excluded resttemplate 6.x from CI
marcingrzejszczak Dec 3, 2022
dde1a24
Added docs
marcingrzejszczak Dec 3, 2022
336a987
Update Application-toolkit-micrometer.md
marcingrzejszczak Dec 3, 2022
297210b
Moved micrometer-1.10.x-plugin to apm-toolkit-activation
marcingrzejszczak Dec 3, 2022
972e2ba
Moved micrometer observation to a separate module
marcingrzejszczak Dec 5, 2022
a39c752
Merge branch 'main' into micrometer
wu-sheng Dec 5, 2022
0539ebe
Update io.micrometer.context.ThreadLocalAccessor
marcingrzejszczak Dec 5, 2022
102cacf
Merge branch 'main' into micrometer
wu-sheng Dec 6, 2022
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: 2 additions & 0 deletions .github/workflows/plugins-jdk17-test.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ jobs:
matrix:
case:
- jdk17-with-gson-scenario
# TODO: We can't test it just yet, because it requires a Skywalking release
# - resttemplate-6.x-scenario
steps:
- uses: actions/checkout@v2
with:
Expand Down
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Release Notes.
* Report the agent version to OAP as an instance attribute
* Polish jedis-4.x-plugin to change command to lowercase, which is consistent with jedis-2.x-3.x-plugin
* Add micronauthttpclient,micronauthttpserver,memcached,ehcache,guavacache,jedis,redisson plugin config properties to agent.config
* Add [Micrometer Observation](https://github.com/micrometer-metrics/micrometer/) support
* Add tags `mq.message.keys` and `mq.message.tags` for RocketMQ producer span

#### Documentation
Expand Down
65 changes: 65 additions & 0 deletions apm-application-toolkit/apm-toolkit-micrometer-1.10/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You 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.
~
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>apm-application-toolkit</artifactId>
<groupId>org.apache.skywalking</groupId>
<version>8.14.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>apm-toolkit-micrometer-1.10</artifactId>
<packaging>jar</packaging>

<url>http://maven.apache.org</url>

<properties>
<micrometer-core.version>1.10.2</micrometer-core.version>
<context-propagation.version>1.0.0</context-propagation.version>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>apm-toolkit-micrometer-registry</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-observation</artifactId>
<version>${micrometer-core.version}</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-core</artifactId>
<version>${micrometer-core.version}</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>context-propagation</artifactId>
<version>${context-propagation.version}</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-test</artifactId>
<version>${micrometer-core.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.apache.skywalking.apm.toolkit.micrometer.observation;

import io.micrometer.context.ThreadLocalAccessor;

/**
* A {@link ThreadLocalAccessor} to put and restore current {@code ContextSnapshot} from APM agent.
*/
public class SkywalkingContextSnapshotThreadLocalAccessor implements ThreadLocalAccessor<Object> {

/**
* Key under which ContextSnapshot is being registered.
*/
public static final String KEY = "skywalking.contextsnapshot";

@Override
public Object key() {
return KEY;
}

// Type will be ContextSnapshot
@Override
public Object getValue() {
return null;
}

// Object to set will be ContextSnapshot
@Override
public void setValue(Object value) {

}

@Override
public void reset() {

}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.apache.skywalking.apm.toolkit.micrometer.observation;

import io.micrometer.observation.Observation;
import io.micrometer.observation.ObservationHandler;

public class SkywalkingDefaultTracingHandler implements ObservationHandler<Observation.Context> {
@Override
public boolean supportsContext(final Observation.Context context) {
return true;
}

@Override
public void onStart(final Observation.Context context) {

}

@Override
public void onError(final Observation.Context context) {

}

@Override
public void onEvent(final Observation.Event event, final Observation.Context context) {

}

@Override
public void onScopeOpened(final Observation.Context context) {

}

@Override
public void onScopeClosed(final Observation.Context context) {

}

@Override
public void onStop(final Observation.Context context) {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.apache.skywalking.apm.toolkit.micrometer.observation;

import io.micrometer.core.instrument.observation.DefaultMeterObservationHandler;
import org.apache.skywalking.apm.meter.micrometer.SkywalkingMeterRegistry;

public class SkywalkingMeterHandler extends DefaultMeterObservationHandler {

public SkywalkingMeterHandler(SkywalkingMeterRegistry meterRegistry) {
super(meterRegistry);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.apache.skywalking.apm.toolkit.micrometer.observation;

import io.micrometer.observation.Observation;
import io.micrometer.observation.ObservationHandler;
import io.micrometer.observation.transport.ReceiverContext;

public class SkywalkingReceiverTracingHandler implements ObservationHandler<ReceiverContext<?>> {
@Override
public boolean supportsContext(final Observation.Context context) {
return context instanceof ReceiverContext;
}

@Override
public void onStart(final ReceiverContext<?> context) {

}

@Override
public void onError(final ReceiverContext<?> context) {

}

@Override
public void onEvent(final Observation.Event event, final ReceiverContext<?> context) {

}

@Override
public void onScopeOpened(final ReceiverContext<?> context) {

}

@Override
public void onScopeClosed(final ReceiverContext<?> context) {

}

@Override
public void onStop(final ReceiverContext<?> context) {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.apache.skywalking.apm.toolkit.micrometer.observation;

import io.micrometer.observation.Observation;
import io.micrometer.observation.ObservationHandler;
import io.micrometer.observation.transport.SenderContext;

public class SkywalkingSenderTracingHandler implements ObservationHandler<SenderContext<?>> {
@Override
public boolean supportsContext(final Observation.Context context) {
return context instanceof SenderContext;
}

@Override
public void onStart(final SenderContext<?> context) {

}

@Override
public void onError(final SenderContext<?> context) {

}

@Override
public void onEvent(final Observation.Event event, final SenderContext<?> context) {

}

@Override
public void onScopeOpened(final SenderContext<?> context) {

}

@Override
public void onScopeClosed(final SenderContext<?> context) {

}

@Override
public void onStop(final SenderContext<?> context) {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.

org.apache.skywalking.apm.toolkit.micrometer.observation.SkywalkingContextSnapshotThreadLocalAccessor
Loading