File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
contrib/opencensus-ext-azure
opencensus/ext/azure/common Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 66([ #1113 ] ( https://github.com/census-instrumentation/opencensus-python/pull/1113 ) )
77- Statsbeat bug fixes - do not log if statsbeat
88([ #1116 ] ( https://github.com/census-instrumentation/opencensus-python/pull/1116 ) )
9+ - Add deprecation warning for explicitly using instrumentation key
10+ ([ #1118 ] ( https://github.com/census-instrumentation/opencensus-python/pull/1118 ) )
911
1012## 1.1.3
1113Released 2022-03-03
Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15+ import logging
1516import os
1617import tempfile
1718
2122INSTRUMENTATION_KEY = 'instrumentationkey'
2223TEMPDIR_PREFIX = "opencensus-python-"
2324
25+ _logger = logging .getLogger (__name__ )
26+
2427
2528def process_options (options ):
2629 # Connection string/ikey
@@ -30,6 +33,13 @@ def process_options(options):
3033 os .getenv ('APPLICATIONINSIGHTS_CONNECTION_STRING' ))
3134 env_ikey = os .getenv ('APPINSIGHTS_INSTRUMENTATIONKEY' )
3235
36+ # Deprecation note about explicit instrumentation key usage
37+ if (not code_cs and code_ikey ) or (not env_cs and env_ikey ):
38+ _logger .warning (
39+ "DeprecationWarning: Explicitly using instrumentation key is"
40+ "deprecated. Please use a connection string instead."
41+ )
42+
3343 # The priority of which value takes on the instrumentation key is:
3444 # 1. Key from explicitly passed in connection string
3545 # 2. Key from explicitly passed in instrumentation key
You can’t perform that action at this time.
0 commit comments