3232 * protected $parentSpanId;
3333 * protected $startTime;
3434 * protected $endTime;
35- * protected $labels ;
35+ * protected $attributes ;
3636 * protected $kind;
3737 *
3838 * public function __construct(array $spanOptions)
6767 * return $this->endTime;
6868 * }
6969 *
70- * public function labels ()
70+ * public function attributes ()
7171 * {
72- * return $this->labels ;
72+ * return $this->attributes ;
7373 * }
7474 *
7575 * public function kind()
@@ -159,18 +159,18 @@ static PHP_METHOD(OpenCensusTraceSpan, parentSpanId) {
159159}
160160
161161/**
162- * Fetch the labels for the span
162+ * Fetch the attributes for the span
163163 *
164164 * @return array
165165 */
166- static PHP_METHOD (OpenCensusTraceSpan , labels ) {
166+ static PHP_METHOD (OpenCensusTraceSpan , attributes ) {
167167 zval * val , rv ;
168168
169169 if (zend_parse_parameters_none () == FAILURE ) {
170170 return ;
171171 }
172172
173- val = zend_read_property (opencensus_trace_span_ce , getThis (), "labels " , sizeof ("labels " ) - 1 , 1 , & rv );
173+ val = zend_read_property (opencensus_trace_span_ce , getThis (), "attributes " , sizeof ("attributes " ) - 1 , 1 , & rv );
174174
175175 RETURN_ZVAL (val , 1 , 0 );
176176}
@@ -249,7 +249,7 @@ static zend_function_entry opencensus_trace_span_methods[] = {
249249 PHP_ME (OpenCensusTraceSpan , name , NULL , ZEND_ACC_PUBLIC )
250250 PHP_ME (OpenCensusTraceSpan , spanId , NULL , ZEND_ACC_PUBLIC )
251251 PHP_ME (OpenCensusTraceSpan , parentSpanId , NULL , ZEND_ACC_PUBLIC )
252- PHP_ME (OpenCensusTraceSpan , labels , NULL , ZEND_ACC_PUBLIC )
252+ PHP_ME (OpenCensusTraceSpan , attributes , NULL , ZEND_ACC_PUBLIC )
253253 PHP_ME (OpenCensusTraceSpan , startTime , NULL , ZEND_ACC_PUBLIC )
254254 PHP_ME (OpenCensusTraceSpan , endTime , NULL , ZEND_ACC_PUBLIC )
255255 PHP_ME (OpenCensusTraceSpan , backtrace , NULL , ZEND_ACC_PUBLIC )
@@ -274,7 +274,7 @@ int opencensus_trace_span_minit(INIT_FUNC_ARGS) {
274274 zend_declare_property_null (opencensus_trace_span_ce , "startTime" , sizeof ("startTime" ) - 1 , ZEND_ACC_PROTECTED TSRMLS_CC );
275275 zend_declare_property_null (opencensus_trace_span_ce , "endTime" , sizeof ("endTime" ) - 1 , ZEND_ACC_PROTECTED TSRMLS_CC );
276276 zend_declare_property_null (opencensus_trace_span_ce , "kind" , sizeof ("kind" ) - 1 , ZEND_ACC_PROTECTED TSRMLS_CC );
277- zend_declare_property_null (opencensus_trace_span_ce , "labels " , sizeof ("labels " ) - 1 , ZEND_ACC_PROTECTED TSRMLS_CC );
277+ zend_declare_property_null (opencensus_trace_span_ce , "attributes " , sizeof ("attributes " ) - 1 , ZEND_ACC_PROTECTED TSRMLS_CC );
278278 zend_declare_property_null (opencensus_trace_span_ce , "backtrace" , sizeof ("backtrace" ) - 1 , ZEND_ACC_PROTECTED TSRMLS_CC );
279279
280280 REGISTER_TRACE_SPAN_CONSTANT (KIND_UNKNOWN );
@@ -299,8 +299,8 @@ opencensus_trace_span_t *opencensus_trace_span_alloc()
299299 span -> span_id = 0 ;
300300 span -> start = 0 ;
301301 span -> stop = 0 ;
302- ALLOC_HASHTABLE (span -> labels );
303- zend_hash_init (span -> labels , 4 , NULL , ZVAL_PTR_DTOR , 0 );
302+ ALLOC_HASHTABLE (span -> attributes );
303+ zend_hash_init (span -> attributes , 4 , NULL , ZVAL_PTR_DTOR , 0 );
304304 return span ;
305305}
306306
@@ -311,8 +311,8 @@ opencensus_trace_span_t *opencensus_trace_span_alloc()
311311 */
312312void opencensus_trace_span_free (opencensus_trace_span_t * span )
313313{
314- /* clear any allocated labels */
315- FREE_HASHTABLE (span -> labels );
314+ /* clear any allocated attributes */
315+ FREE_HASHTABLE (span -> attributes );
316316 if (span -> name ) {
317317 zend_string_release (span -> name );
318318 }
@@ -321,24 +321,24 @@ void opencensus_trace_span_free(opencensus_trace_span_t *span)
321321 efree (span );
322322}
323323
324- /* Add a label to the trace span struct */
325- int opencensus_trace_span_add_label (opencensus_trace_span_t * span , zend_string * k , zend_string * v )
324+ /* Add a attribute to the trace span struct */
325+ int opencensus_trace_span_add_attribute (opencensus_trace_span_t * span , zend_string * k , zend_string * v )
326326{
327327 /* put the string value into a zval and save it in the HashTable */
328328 zval zv ;
329329 ZVAL_STRING (& zv , ZSTR_VAL (v ));
330330
331- if (zend_hash_update (span -> labels , zend_string_copy (k ), & zv ) == NULL ) {
331+ if (zend_hash_update (span -> attributes , zend_string_copy (k ), & zv ) == NULL ) {
332332 return FAILURE ;
333333 } else {
334334 return SUCCESS ;
335335 }
336336}
337337
338- /* Add a single label to the provided trace span struct */
339- int opencensus_trace_span_add_label_str (opencensus_trace_span_t * span , char * k , zend_string * v )
338+ /* Add a single attribute to the provided trace span struct */
339+ int opencensus_trace_span_add_attribute_str (opencensus_trace_span_t * span , char * k , zend_string * v )
340340{
341- return opencensus_trace_span_add_label (span , zend_string_init (k , strlen (k ), 0 ), v );
341+ return opencensus_trace_span_add_attribute (span , zend_string_init (k , strlen (k ), 0 ), v );
342342}
343343
344344/* Update the provided span with the provided zval (array) of span options */
@@ -348,8 +348,8 @@ int opencensus_trace_span_apply_span_options(opencensus_trace_span_t *span, zval
348348 zval * v ;
349349
350350 ZEND_HASH_FOREACH_STR_KEY_VAL (Z_ARR_P (span_options ), k , v ) {
351- if (strcmp (ZSTR_VAL (k ), "labels " ) == 0 ) {
352- zend_hash_merge (span -> labels , Z_ARRVAL_P (v ), zval_add_ref , 0 );
351+ if (strcmp (ZSTR_VAL (k ), "attributes " ) == 0 ) {
352+ zend_hash_merge (span -> attributes , Z_ARRVAL_P (v ), zval_add_ref , 0 );
353353 } else if (strcmp (ZSTR_VAL (k ), "startTime" ) == 0 ) {
354354 span -> start = Z_DVAL_P (v );
355355 } else if (strcmp (ZSTR_VAL (k ), "name" ) == 0 ) {
0 commit comments